mirror of
https://github.com/rootzoll/raspiblitz.git
synced 2025-03-01 00:59:23 +01:00
offer mingration/update/recover also in setup menu
This commit is contained in:
parent
1d80a0cf57
commit
9f9c38bf37
2 changed files with 38 additions and 3 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue