Browse Source

added close all channels to main menu

#146
rootzoll 6 years ago
parent
commit
cfd38f453b
  1. 10
      home.admin/00mainMenu.sh
  2. 22
      home.admin/BBcloseAllChannels.sh

10
home.admin/00mainMenu.sh

@ -75,6 +75,10 @@ else
lnchannels "Lightning Channel List")
# Depending Options
openChannels=$(sudo -u bitcoin lncli listchannels 2>/dev/null | grep chan_id -c)
if [ ${openChannels} -gt 0 ]; then
OPTIONS+=(CLOSEALL "Close all open Channels")
fi
if [ "${network}" = "bitcoin" ]; then
OPTIONS+=(SWITCH "Switch ${switchOption}")
fi
@ -149,6 +153,12 @@ case $CHOICE in
read key
./00mainMenu.sh
;;
CLOSEALL)
./BBcloseAllChannels.sh
echo "Press ENTER to return to main menu."
read key
./00mainMenu.sh
;;
SWITCH)
sudo ./95switchMainTest.sh
echo "Press ENTER to return to main menu."

22
home.admin/BBcloseAllChannels.sh

@ -23,17 +23,25 @@ if [ ${chainInSync} -eq 0 ]; then
result="FAIL PRECHECK - lncli getinfo shows 'synced_to_chain': false - wait until chain is sync "
fi
# TODO PRECHECK) are any channels open at all
# TODO PRECHECK) are there INACTIVE channels that would need a force close (and manual YES)
# remember that for info below
# execute command
if [ ${#command} -gt 0 ]; then
${command}
fi
echo ""
echo "OK your list of channels looks now like this:"
echo "OK"
sleep 2
lnchannels
openChannels=$(sudo -u bitcoin lncli listchannels 2>/dev/null | grep chan_id -c)
if [ ${openChannels} -gt 0 ]; then
echo ""
echo "*******************"
echo "OK All Channels are closed now."
echo "You can now switch test/main or update RaspiBlitz safely, as long as you got your CIPHER WORD LIST SEED."
echo "*******************"
else
echo "!! WARNING you still have open channels:"
lnchannels
fi

Loading…
Cancel
Save