don't do first run if no admin user set

This commit is contained in:
paukstelis
2023-01-02 09:25:28 -05:00
parent b1aefac8fe
commit fe0a13f9fe

View File

@@ -11,7 +11,7 @@ if [ $SUDO_USER ]; then
user=$SUDO_USER user=$SUDO_USER
else else
echo "You should not run this script as root. Use sudo as a normal user" echo "You should not run this script as root. Use sudo as a normal user"
exit exit
fi fi
if [ "$user" == root ]; then if [ "$user" == root ]; then
@@ -982,37 +982,39 @@ firstrun() {
echo "Admin password: $OCTOPASS" echo "Admin password: $OCTOPASS"
$OCTOEXEC user add $OCTOADMIN --password $OCTOPASS --admin | log $OCTOEXEC user add $OCTOADMIN --password $OCTOPASS --admin | log
fi fi
echo if [ -n "$OCTOADMIN" ]; then
echo echo
echo "The script can complete the first run wizards now. For more information on these, see the OctoPrint website." echo
echo "It is standard to accept these, as no identifying information is exposed through their usage." echo "The script can complete the first run wizards now. For more information on these, see the OctoPrint website."
echo echo "It is standard to accept these, as no identifying information is exposed through their usage."
echo echo
if prompt_confirm "Do first run wizards now?"; then echo
$OCTOEXEC config set server.firstRun false --bool | log if prompt_confirm "Do first run wizards now?"; then
$OCTOEXEC config set server.seenWizards.backup null | log $OCTOEXEC config set server.firstRun false --bool | log
$OCTOEXEC config set server.seenWizards.corewizard 4 --int | log $OCTOEXEC config set server.seenWizards.backup null | log
$OCTOEXEC config set server.seenWizards.corewizard 4 --int | log
if prompt_confirm "Enable online connectivity check?"; then
$OCTOEXEC config set server.onlineCheck.enabled true --bool if prompt_confirm "Enable online connectivity check?"; then
else $OCTOEXEC config set server.onlineCheck.enabled true --bool
$OCTOEXEC config set server.onlineCheck.enabled false --bool else
fi $OCTOEXEC config set server.onlineCheck.enabled false --bool
fi
if prompt_confirm "Enable plugin blacklisting?"; then
$OCTOEXEC config set server.pluginBlacklist.enabled true --bool if prompt_confirm "Enable plugin blacklisting?"; then
else $OCTOEXEC config set server.pluginBlacklist.enabled true --bool
$OCTOEXEC config set server.pluginBlacklist.enabled false --bool else
fi $OCTOEXEC config set server.pluginBlacklist.enabled false --bool
fi
if prompt_confirm "Enable anonymous usage tracking?"; then
$OCTOEXEC config set plugins.tracking.enabled true --bool if prompt_confirm "Enable anonymous usage tracking?"; then
else $OCTOEXEC config set plugins.tracking.enabled true --bool
$OCTOEXEC config set plugins.tracking.enabled false --bool else
fi $OCTOEXEC config set plugins.tracking.enabled false --bool
fi
if prompt_confirm "Use default printer (can be changed later)?"; then
$OCTOEXEC config set printerProfiles.default _default if prompt_confirm "Use default printer (can be changed later)?"; then
$OCTOEXEC config set printerProfiles.default _default
fi
fi fi
fi fi