exit states

This commit is contained in:
rootzoll
2021-05-03 14:21:29 +02:00
parent 2b2058ffbf
commit e09d951920
2 changed files with 18 additions and 12 deletions

View File

@@ -81,16 +81,14 @@ or having a complete LND rescue-backup from your old node.
fi fi
else else
echo "# you selected cancel - exited to terminal" # user cancel - signal to outside app by exit code (2 = submenu)
echo "# use command 'restart' to reboot & start again" exit 2
exit 1
fi fi
done done
else else
echo "# you selected cancel - exited to terminal" # user cancel - signal to outside app by exit code (1 = mainmenu)
echo "# use command 'restart' to reboot & start again"
exit 1 exit 1
fi fi
@@ -105,8 +103,8 @@ if [ ${uploadLNDRESCUE} -eq 1 ]; then
# if user canceled upload # if user canceled upload
if [ "${lndrescue}" == "" ]; then if [ "${lndrescue}" == "" ]; then
# signal cancel to the calling script by exit code # signal cancel to the calling script by exit code (3 = exit on lndrescue)
exit 1 exit 3
fi fi
# clear setup state from all fomer possible choices (previous loop) # clear setup state from all fomer possible choices (previous loop)
@@ -127,8 +125,8 @@ if [ ${enterSEED} -eq 1 ]; then
# if user canceled the seed input # if user canceled the seed input
if [ "${seedWords}" == "" ]; then if [ "${seedWords}" == "" ]; then
# signal cancel to the calling script by exit code # signal cancel to the calling script by exit code (4 = exit on seedwords)
exit 1 exit 4
fi fi
# clear setup state from all fomer possible choices (previous loop) # clear setup state from all fomer possible choices (previous loop)
@@ -151,8 +149,8 @@ if [ ${uploadSCB} -eq 1 ]; then
# if user canceled the upload # if user canceled the upload
if [ "${staticchannelbackup}" == "" ]; then if [ "${staticchannelbackup}" == "" ]; then
# signal cancel to the calling script by exit code # signal cancel to the calling script by exit code (5 = exit on scb)
exit 1 exit 5
fi fi
# clear setup state from all fomer possible choices (previous loop) # clear setup state from all fomer possible choices (previous loop)

View File

@@ -55,7 +55,7 @@ else
# Setting Name for Node # Setting Name for Node
echo "# Starting basic setup dialog ..." echo "# Starting basic setup dialog ..."
/home/admin/setup.scripts/dialogPasswords.sh /home/admin/setup.scripts/dialogName.sh
############################################ ############################################
# Lightning Wallet (new or restore) do this before passwords # Lightning Wallet (new or restore) do this before passwords
@@ -73,6 +73,14 @@ else
lightningWalletDone=1 lightningWalletDone=1
fi fi
# allow user to cancel to terminal on dialog main menu
# all other cancels have other exit codes
if [ "$?" == "1" ]; then
echo "# you selected cancel - exited to terminal"
echo "# to re-start setup use command --> setup"
exit 1
fi
done done
fi fi