mirror of
https://github.com/raspiblitz/raspiblitz.git
synced 2025-09-22 16:10:55 +02:00
adjust exit codes in menu scripts
This commit is contained in:
@@ -37,10 +37,10 @@ clear
|
||||
echo "dialogcancel(${dialogcancel})"
|
||||
if [ ${dialogcancel} -eq 1 ]; then
|
||||
echo "user canceled"
|
||||
exit 1
|
||||
exit 0
|
||||
elif [ ${dialogcancel} -eq 255 ]; then
|
||||
echo "ESC pressed"
|
||||
exit 1
|
||||
exit 0
|
||||
fi
|
||||
|
||||
needsReboot=0
|
||||
|
@@ -37,10 +37,10 @@ clear
|
||||
echo "dialogcancel(${dialogcancel})"
|
||||
if [ ${dialogcancel} -eq 1 ]; then
|
||||
echo "user canceled"
|
||||
exit 1
|
||||
exit 0
|
||||
elif [ ${dialogcancel} -eq 255 ]; then
|
||||
echo "ESC pressed"
|
||||
exit 1
|
||||
exit 0
|
||||
fi
|
||||
|
||||
needsReboot=0
|
||||
|
@@ -117,10 +117,10 @@ clear
|
||||
echo "dialogcancel(${dialogcancel})"
|
||||
if [ ${dialogcancel} -eq 1 ]; then
|
||||
echo "user canceled"
|
||||
exit 1
|
||||
exit 0
|
||||
elif [ ${dialogcancel} -eq 255 ]; then
|
||||
echo "ESC pressed"
|
||||
exit 1
|
||||
exit 0
|
||||
fi
|
||||
|
||||
needsReboot=0
|
||||
|
@@ -60,10 +60,10 @@ clear
|
||||
echo "dialogcancel(${dialogcancel})"
|
||||
if [ ${dialogcancel} -eq 1 ]; then
|
||||
echo "user canceled"
|
||||
exit 1
|
||||
exit 0
|
||||
elif [ ${dialogcancel} -eq 255 ]; then
|
||||
echo "ESC pressed"
|
||||
exit 1
|
||||
exit 0
|
||||
fi
|
||||
|
||||
needsReboot=0
|
||||
|
@@ -155,7 +155,7 @@ clear
|
||||
echo "creating install info ..."
|
||||
case $CHOICE in
|
||||
CLOSE)
|
||||
exit 1;
|
||||
exit 0;
|
||||
;;
|
||||
SPHINX)
|
||||
if [ "${sphinxrelay}" != "on" ]; then
|
||||
@@ -173,7 +173,7 @@ case $CHOICE in
|
||||
fi
|
||||
# make pairing thru sphinx relay script
|
||||
/home/admin/config.scripts/bonus.sphinxrelay.sh menu
|
||||
exit 1;
|
||||
exit 0;
|
||||
;;
|
||||
ZAP_IOS)
|
||||
appstoreLink="https://apps.apple.com/us/app/zap-bitcoin-lightning-wallet/id1406311960"
|
||||
@@ -206,7 +206,7 @@ Or scan the qr code on the LCD with your mobile phone.
|
||||
choose_IP_or_TOR
|
||||
fi
|
||||
/home/admin/config.scripts/bonus.lndconnect.sh zap-ios ${connect}
|
||||
exit 1;
|
||||
exit 0;
|
||||
;;
|
||||
ZAP_ANDROID)
|
||||
appstoreLink="https://play.google.com/store/apps/details?id=zapsolutions.zap"
|
||||
@@ -229,7 +229,7 @@ Or scan the qr code on the LCD with your mobile phone.
|
||||
choose_IP_or_TOR
|
||||
fi
|
||||
/home/admin/config.scripts/bonus.lndconnect.sh zap-android ${connect}
|
||||
exit 1;
|
||||
exit 0;
|
||||
;;
|
||||
SENDMANY_ANDROID)
|
||||
|
||||
@@ -241,7 +241,7 @@ To use the chat feature of the SendMany app, you need to activate the Keysend fe
|
||||
|
||||
Please go to MAINMENU > SERVICES and activate KEYSEND first.
|
||||
" 12 65
|
||||
exit 1
|
||||
exit 0
|
||||
fi
|
||||
|
||||
appstoreLink="https://github.com/fusion44/sendmany/releases"
|
||||
@@ -256,7 +256,7 @@ Please go to MAINMENU > SERVICES and activate KEYSEND first.
|
||||
/home/admin/config.scripts/blitz.display.sh hide
|
||||
checkIP2TOR LND-GRPC-API
|
||||
/home/admin/config.scripts/bonus.lndconnect.sh sendmany-android ${connect}
|
||||
exit 1;
|
||||
exit 0;
|
||||
;;
|
||||
ZEUS_IOS)
|
||||
appstoreLink="https://testflight.apple.com/join/gpVFzEHN"
|
||||
@@ -271,7 +271,7 @@ Please go to MAINMENU > SERVICES and activate KEYSEND first.
|
||||
fi
|
||||
/home/admin/config.scripts/blitz.display.sh hide
|
||||
/home/admin/config.scripts/bonus.lndconnect.sh zeus-ios tor
|
||||
exit 1;
|
||||
exit 0;
|
||||
;;
|
||||
ZEUS_ANDROID)
|
||||
appstoreLink="https://play.google.com/store/apps/details?id=app.zeusln.zeus"
|
||||
@@ -290,7 +290,7 @@ Or scan the qr code on the LCD with your mobile phone.
|
||||
fi
|
||||
/home/admin/config.scripts/blitz.display.sh hide
|
||||
/home/admin/config.scripts/bonus.lndconnect.sh zeus-android tor
|
||||
exit 1;
|
||||
exit 0;
|
||||
;;
|
||||
FULLY_NODED)
|
||||
appstoreLink="https://apps.apple.com/us/app/fully-noded/id1436425586"
|
||||
@@ -309,6 +309,6 @@ Or scan the qr code on the LCD with your mobile phone.
|
||||
fi
|
||||
/home/admin/config.scripts/blitz.display.sh hide
|
||||
/home/admin/config.scripts/bonus.fullynoded.sh
|
||||
exit 1;
|
||||
exit 0;
|
||||
;;
|
||||
esac
|
||||
|
@@ -118,7 +118,7 @@ case $CHOICE in
|
||||
|
||||
# go back to main menu (and show)
|
||||
/home/admin/00raspiblitz.sh
|
||||
exit 1;
|
||||
exit 0;
|
||||
;;
|
||||
RESET-HDD)
|
||||
askBackupCopy
|
||||
@@ -136,11 +136,11 @@ case $CHOICE in
|
||||
;;
|
||||
DELETE-ELEC)
|
||||
/home/admin/config.scripts/bonus.electrs.sh off deleteindex
|
||||
exit 1;
|
||||
exit 0;
|
||||
;;
|
||||
DELETE-INDEX)
|
||||
/home/admin/config.scripts/network.txindex.sh delete
|
||||
exit 1;
|
||||
exit 0;
|
||||
;;
|
||||
COPY-SOURCE)
|
||||
/home/admin/config.scripts/blitz.copychain.sh source
|
||||
|
@@ -21,7 +21,7 @@ No need to close channels or download blockchain again.
|
||||
Do you want to start the Update now?
|
||||
" 16 62
|
||||
if [ $? -eq 0 ]; then
|
||||
exit 1
|
||||
exit 0
|
||||
fi
|
||||
|
||||
whiptail --title "LND Data Backup" --yes-button "Download Backup" --no-button "Skip" --yesno "
|
||||
@@ -69,7 +69,7 @@ and do you WANT TO START UPDATE NOW?
|
||||
OK. RaspiBlitz will NOT update now.
|
||||
" 7 39
|
||||
sudo systemctl start lnd
|
||||
exit 1
|
||||
exit 0
|
||||
fi
|
||||
|
||||
clear
|
||||
@@ -93,7 +93,7 @@ hotfix the code and might compromise your security.
|
||||
Do you want to Patch your RaspiBlitz now?
|
||||
" 18 58
|
||||
if [ $? -eq 0 ]; then
|
||||
exit 1
|
||||
exit 0
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -128,10 +128,11 @@ patch()
|
||||
echo "REBOOT .."
|
||||
/home/admin/config.scripts/blitz.shutdown.sh reboot
|
||||
sleep 8
|
||||
exit 1
|
||||
else
|
||||
echo "SKIP REBOOT .."
|
||||
exit 0
|
||||
fi
|
||||
exit 1
|
||||
;;
|
||||
REPO)
|
||||
clear
|
||||
@@ -148,7 +149,7 @@ patch()
|
||||
fi
|
||||
fi
|
||||
patch
|
||||
exit 1
|
||||
exit 0
|
||||
;;
|
||||
BRANCH)
|
||||
clear
|
||||
@@ -165,7 +166,7 @@ patch()
|
||||
fi
|
||||
fi
|
||||
patch
|
||||
exit 1
|
||||
exit 0
|
||||
;;
|
||||
PR)
|
||||
clear
|
||||
@@ -186,7 +187,7 @@ patch()
|
||||
/home/admin/config.scripts/blitz.github.sh -justinstall
|
||||
fi
|
||||
fi
|
||||
exit 1
|
||||
exit 0
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -212,7 +213,7 @@ lnd()
|
||||
VERIFIED)
|
||||
if [ ${lndUpdateInstalled} -eq 1 ]; then
|
||||
whiptail --title "ALREADY INSTALLED" --msgbox "The LND version ${lndUpdateVersion} is already installed." 8 30
|
||||
exit 1
|
||||
exit 0
|
||||
fi
|
||||
whiptail --title "OPTIONAL LND UPDATE" --yes-button "Cancel" --no-button "Update" --yesno "BEWARE on updating to LND v${lndUpdateVersion}:
|
||||
|
||||
@@ -222,7 +223,7 @@ Do you really want to update LND now?
|
||||
" 16 58
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "# cancel update"
|
||||
exit 1
|
||||
exit 0
|
||||
fi
|
||||
# if loop is installed remove
|
||||
if [ "${loop}" == "on" ]; then
|
||||
@@ -255,7 +256,7 @@ Do you really want to update LND now?
|
||||
" 16 58
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "# cancel update"
|
||||
exit 1
|
||||
exit 0
|
||||
fi
|
||||
error=""
|
||||
source <(sudo -u admin /home/admin/config.scripts/lnd.update.sh reckless)
|
||||
@@ -296,7 +297,7 @@ bitcoinUpdate() {
|
||||
if [ ${bitcoinUpdateInstalled} -eq 1 ]; then
|
||||
whiptail --title "ALREADY INSTALLED" \
|
||||
--msgbox "The Bitcoin Core version ${bitcoinUpdateVersion} is already installed." 8 30
|
||||
exit 1
|
||||
exit 0
|
||||
fi
|
||||
whiptail --title "OPTIONAL Bitcoin Core update" --yes-button "Cancel" --no-button "Update" \
|
||||
--yesno "Info on updating to Bitcoin Core v${bitcoinVersion}:
|
||||
@@ -308,7 +309,7 @@ Do you really want to update Bitcoin Core now?
|
||||
" 12 58
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "# cancel update"
|
||||
exit 1
|
||||
exit 0
|
||||
fi
|
||||
|
||||
error=""
|
||||
@@ -332,7 +333,7 @@ Do you really want to update Bitcoin Core now?
|
||||
" 16 58
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "# cancel update"
|
||||
exit 1
|
||||
exit 0
|
||||
fi
|
||||
error=""
|
||||
source <(sudo -u admin /home/admin/config.scripts/bitcoin.update.sh reckless)
|
||||
|
@@ -33,13 +33,13 @@ if [ ${#openChannels} -eq 0 ]; then
|
||||
echo "************************************************"
|
||||
echo "Press ENTER to return to main menu."
|
||||
read key
|
||||
exit 1
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ ${openChannels} -gt 0 ]; then
|
||||
whiptail --title 'Info' --yes-button='Cashout Anyway' --no-button='Go Back' --yesno 'You still have funds in open Lightning Channels.\nUse CLOSEALL first if you want to cashout all funds.\nNOTICE: Just confirmed on-chain funds can be moved.' 10 56
|
||||
if [ $? -eq 1 ]; then
|
||||
exit 1
|
||||
exit 0
|
||||
fi
|
||||
echo "..."
|
||||
fi
|
||||
@@ -59,7 +59,7 @@ fi
|
||||
if [ ${unconfirmed} -gt 0 ]; then
|
||||
whiptail --title 'Info' --yes-button='Cashout Anyway' --no-button='Go Back' --yesno "Still waiting confirmation for (some of) your funds.\nNOTICE: Just confirmed on-chain funds can be moved." 8 58
|
||||
if [ $? -eq 1 ]; then
|
||||
exit 1
|
||||
exit 0
|
||||
fi
|
||||
echo "..."
|
||||
fi
|
||||
@@ -72,7 +72,7 @@ then
|
||||
echo "ok pressed"
|
||||
else
|
||||
echo "cancel pressed"
|
||||
exit 1
|
||||
exit 0
|
||||
fi
|
||||
address=$(cat $_temp | xargs)
|
||||
shred -u $_temp
|
||||
@@ -80,7 +80,7 @@ if [ ${#address} -eq 0 ]; then
|
||||
echo "FAIL - not a valid address (${address})"
|
||||
echo "Press ENTER to return to main menu."
|
||||
read key
|
||||
exit 1
|
||||
exit 0
|
||||
fi
|
||||
|
||||
clear
|
||||
|
@@ -34,7 +34,7 @@ elif [ $LNTYPE = lnd ];then
|
||||
# precheck: AutoPilot
|
||||
if [ "${autoPilot}" = "on" ]; then
|
||||
dialog --title 'Info' --msgbox 'You need to turn OFF the LND AutoPilot first,\nso that closed channels are not opening up again.\nYou find the AutoPilot -----> SERVICES section' 7 55
|
||||
exit 1
|
||||
exit 0
|
||||
fi
|
||||
command="$lncli_alias closeallchannels --force"
|
||||
fi
|
||||
@@ -62,7 +62,7 @@ if [ ${chainOutSync} -eq 1 ]; then
|
||||
echo
|
||||
echo "# PRESS ENTER to return to menu"
|
||||
read key
|
||||
exit 1
|
||||
exit 0
|
||||
else
|
||||
echo "# OK - the chain is synced"
|
||||
fi
|
||||
@@ -87,6 +87,4 @@ fi
|
||||
|
||||
echo
|
||||
echo "# OK - please recheck if channels really closed"
|
||||
sleep 5
|
||||
|
||||
#TODO exits to CLI, not returning to menu
|
||||
sleep 5
|
@@ -32,7 +32,7 @@ if [ ${#_input} -eq 0 ]; then
|
||||
echo
|
||||
echo "no peer entered - returning to menu ..."
|
||||
sleep 2
|
||||
exit 1
|
||||
exit 0
|
||||
fi
|
||||
|
||||
pubkey=$(echo "${_input}"|cut -d@ -f1)
|
||||
|
@@ -40,7 +40,7 @@ while [ "${chainInSync}" == "0" ]; do
|
||||
--pause "\n\n'$lncommand getinfo' shows 'synced_to_chain': false\n\nTry again in a few seconds." 15 60 5
|
||||
|
||||
if [ $? -gt 0 ]; then
|
||||
exit 1
|
||||
exit 0
|
||||
fi
|
||||
chainInSync=${cmdChainInSync}
|
||||
done
|
||||
@@ -57,8 +57,8 @@ if [ ${openChannels} -eq 0 ]; then
|
||||
echo "!!!!!!!!!!!!!!!!!!!"
|
||||
echo "FAIL - You have NO ESTABLISHED CHANNELS .. open a channel first."
|
||||
echo "!!!!!!!!!!!!!!!!!!!"
|
||||
echo
|
||||
exit 1
|
||||
sleep 3
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# let user enter the invoice
|
||||
@@ -72,8 +72,8 @@ if [ ${#amount} -eq 0 ]; then
|
||||
clear
|
||||
echo
|
||||
echo "no amount entered - returning to menu ..."
|
||||
sleep 2
|
||||
exit 1
|
||||
sleep 3
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# TODO let user enter a description
|
||||
|
@@ -34,7 +34,7 @@ if [ ${chainOutSync} -eq 1 ]; then
|
||||
echo
|
||||
echo "# PRESS ENTER to return to menu"
|
||||
read key
|
||||
exit 1
|
||||
exit 0
|
||||
else
|
||||
echo "# OK - the chain is synced"
|
||||
fi
|
||||
|
@@ -36,7 +36,7 @@ if [ ${chainOutSync} -eq 1 ]; then
|
||||
echo
|
||||
echo "# PRESS ENTER to return to menu"
|
||||
read key
|
||||
exit 1
|
||||
exit 0
|
||||
else
|
||||
echo "# OK - the chain is synced"
|
||||
fi
|
||||
@@ -57,7 +57,7 @@ if [ ${confirmedBalance} -eq 0 ]; then
|
||||
echo
|
||||
echo "Press ENTER to return to main menu."
|
||||
read key
|
||||
exit 1
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# check number of connected peers
|
||||
@@ -74,7 +74,7 @@ if [ ${numConnectedPeers} -eq 0 ]; then
|
||||
echo
|
||||
echo "Press ENTER to return to main menu."
|
||||
read key
|
||||
exit 1
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# let user pick a peer to open a channels with
|
||||
@@ -109,7 +109,7 @@ if [ ${#pubKey} -eq 0 ]; then
|
||||
echo
|
||||
echo "no channel selected - returning to menu ..."
|
||||
sleep 4
|
||||
exit 1
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# find out what is the minimum amount
|
||||
@@ -140,7 +140,7 @@ if [ ${#amount} -eq 0 ]; then
|
||||
echo
|
||||
echo "no valid amount entered - returning to menu ..."
|
||||
sleep 4
|
||||
exit 1
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# let user enter a confirmation target
|
||||
@@ -154,7 +154,7 @@ if [ ${#conf_target} -eq 0 ]; then
|
||||
echo
|
||||
echo "no valid target entered - returning to menu ..."
|
||||
sleep 4
|
||||
exit 1
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# build command
|
||||
|
@@ -40,7 +40,7 @@ while [ "${chainInSync}" == "0" ]; do
|
||||
--pause "\n\n'$lncommand getinfo' shows 'synced_to_chain': false\n\nTry again in a few seconds." 15 60 5
|
||||
|
||||
if [ $? -gt 0 ]; then
|
||||
exit 1
|
||||
exit 0
|
||||
fi
|
||||
chainInSync=${cmdChainInSync}
|
||||
done
|
||||
@@ -57,8 +57,9 @@ if [ ${openChannels} -eq 0 ]; then
|
||||
echo "!!!!!!!!!!!!!!!!!!!"
|
||||
echo "FAIL - You have NO ESTABLISHED CHANNELS .. open a channel first."
|
||||
echo "!!!!!!!!!!!!!!!!!!!"
|
||||
sleep 3
|
||||
echo
|
||||
exit 1
|
||||
exit 0
|
||||
fi
|
||||
|
||||
paymentRequestStart="???"
|
||||
@@ -95,8 +96,8 @@ if [ ${#invoice} -eq 0 ]; then
|
||||
clear
|
||||
echo
|
||||
echo "no invoice entered - returning to menu ..."
|
||||
sleep 2
|
||||
exit 1
|
||||
sleep 3
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# TODO: maybe try/show the decoded info first by using https://api.lightning.community/#decodepayreq
|
||||
|
Reference in New Issue
Block a user