diff --git a/home.admin/setup.scripts/controlSetupDialog.sh b/home.admin/setup.scripts/controlSetupDialog.sh index 2afb0d79a..7546052e2 100755 --- a/home.admin/setup.scripts/controlSetupDialog.sh +++ b/home.admin/setup.scripts/controlSetupDialog.sh @@ -38,7 +38,7 @@ if [ "${setupPhase}" == "update" ]; then # default to normal setup options setupPhase="setup" sudo sed -i "s/^setupPhase=.*/setupPhase='setup'/g" /home/admin/raspiblitz.info - echo "# you refused recovery option - defaulting to normal setup" + echo "# you refused recovery option - defaulting to normal setup menu" fi fi @@ -55,7 +55,7 @@ if [ "${setupPhase}" == "recovery" ]; then # default to normal setup options setupPhase="setup" sudo sed -i "s/^setupPhase=.*/setupPhase='setup'/g" /home/admin/raspiblitz.info - echo "# you refused recovery option - defaulting to normal setup" + echo "# you refused recovery option - defaulting to normal setup menu" fi fi @@ -88,9 +88,28 @@ fi if [ "${setupPhase}" == "setup" ]; then echo "# Starting basic setup dialog ..." - /home/admin/setup.scripts/dialogBasicSetup.sh + /home/admin/setup.scripts/dialogBasicSetup.sh ${orgSetupPhase} menuresult=$? + # menu REVOVER menu option + if [ "${menuresult}" == "4" ]; then + setupPhase="${orgSetupPhase}" + # proceed with provision (mark Password A to be set) + echo "# OK update process starting .." + echo "setPasswordA=1" >> $SETUPFILE + fi + + # menu MIGRATE menu option + if [ "${menuresult}" == "5" ]; then + setupPhase="${orgSetupPhase}" + # mark migration to happen on provision + echo "migrationOS='${hddGotMigrationData}'" >> $SETUPFILE + # user needs to reset password A, B & C + echo "setPasswordA=1" >> $SETUPFILE + echo "setPasswordB=1" >> $SETUPFILE + echo "setPasswordC=1" >> $SETUPFILE + fi + # exit to terminal if [ "${menuresult}" == "3" ]; then exit 1 diff --git a/home.admin/setup.scripts/dialogBasicSetup.sh b/home.admin/setup.scripts/dialogBasicSetup.sh index 9c0a65b48..8a9b6b8dc 100644 --- a/home.admin/setup.scripts/dialogBasicSetup.sh +++ b/home.admin/setup.scripts/dialogBasicSetup.sh @@ -4,9 +4,17 @@ # these are the same set of infos the WebGUI dialog/controler has source /home/admin/_version.info +specialOption=$2 # (optional - can be 'update', 'recovery' or 'migration' ) + # chose how to setup node (fresh or from a upload backup) OPTIONS=() OPTIONS+=(FRESHSETUP "Setup a new RaspiBlitz") +if [ "${specialOption}" == "update" ] || [ "${specialOption}" == "recovery" ]; then + OPTIONS+=(RECOVER "Recover/Update existing RaspiBlitz") +fi +if [ "${specialOption}" == "migration" ]; then + OPTIONS+=(CHANGE "Make Node a RaspiBlitz") +fi OPTIONS+=(FROMBACKUP "Upload Migration Backup") OPTIONS+=(SHUTDOWN "Shutdown without Changes") CHOICE=$(dialog --clear \ @@ -33,6 +41,14 @@ case $CHOICE in echo "Cut power when you see no status LED blinking anymore." exit 2 ;; + RECOVER) + # 4 --> RECOVER / UPDATE + exit 4 + ;; + CHANGE) + # 5 --> MIGRATE + exit 5 + ;; *) # 3 --> ESC/CANCEL = EXIT TO TERMINAL clear