loop on cancel

This commit is contained in:
rootzoll 2021-05-21 20:46:18 -05:00
parent 485abcacca
commit b8e322578c
2 changed files with 7 additions and 6 deletions

View file

@ -13,7 +13,7 @@ CHOICE=$(dialog --clear \
--backtitle "RaspiBlitz ${codeVersion} - Setup" \ --backtitle "RaspiBlitz ${codeVersion} - Setup" \
--title "⚡ Welcome to your RaspiBlitz ⚡" \ --title "⚡ Welcome to your RaspiBlitz ⚡" \
--menu "\nChoose how you want to setup your RaspiBlitz: \n " \ --menu "\nChoose how you want to setup your RaspiBlitz: \n " \
13 64 7 \ 12 64 6 \
"${OPTIONS[@]}" \ "${OPTIONS[@]}" \
2>&1 >/dev/tty) 2>&1 >/dev/tty)
clear clear
@ -28,6 +28,9 @@ case $CHOICE in
;; ;;
SHUTDOWN) SHUTDOWN)
# 2 --> SHUTDOWN # 2 --> SHUTDOWN
clear
echo "Shutting down without changes ..."
echo "Cut power when you see no status LED action anymore."
exit 2 exit 2
;; ;;
*) *)

View file

@ -82,7 +82,7 @@ if [ "${setupPhase}" == "setup" ]; then
# exit to terminal # exit to terminal
if [ "${menuresult}" == "3" ]; then if [ "${menuresult}" == "3" ]; then
exit 0 exit 1
fi fi
# shutdown without changes # shutdown without changes
@ -95,8 +95,7 @@ if [ "${setupPhase}" == "setup" ]; then
if [ "${menuresult}" == "1" ]; then if [ "${menuresult}" == "1" ]; then
/home/admin/setup.scripts/dialogMigration.sh raspiblitz /home/admin/setup.scripts/dialogMigration.sh raspiblitz
if [ "$?" == "1" ]; then if [ "$?" == "1" ]; then
echo "Upload did not worked ... doing shutdown. Restart for new try." # upload did not worked .. exit with 0 to restart process from outside loop
sudo shutdown now
exit 0 exit 0
fi fi
# user needs to reset password A # user needs to reset password A
@ -113,8 +112,7 @@ if [ "${setupPhase}" == "setup" ]; then
echo "# Starting Blockchain & Lightning selection ..." echo "# Starting Blockchain & Lightning selection ..."
/home/admin/setup.scripts/dialogBlockchainLightning.sh /home/admin/setup.scripts/dialogBlockchainLightning.sh
if [ "$?" == "1" ]; then if [ "$?" == "1" ]; then
echo "Shutting down ... Restart for new try." # exit with 0 to restart process from outside loop
sudo shutdown now
exit 0 exit 0
fi fi