Browse Source

moved wallet locked detection

master
Christian Rotzoll 6 years ago
parent
commit
5a43cb2b5d
  1. 26
      home.admin/00infoLCD.sh
  2. 19
      home.admin/80scanLND.sh
  3. 8
      home.admin/config.scripts/blitz.statusscan.sh

26
home.admin/00infoLCD.sh

@ -197,32 +197,6 @@ while :
continue
fi
# check if locked
locked=$(sudo -u bitcoin lncli --chain=${network} --network=${chain}net getinfo 2>&1 | grep -c unlock)
if [ "${locked}" -gt 0 ]; then
# special case: LND wallet is locked ---> show unlock info
h=5
l1="!!! LND WALLET IS LOCKED !!!\n"
l2="Login: ssh admin@${localip}\n"
l3="Use your Password A\n"
l4=""
if [ "${rtlWebinterface}" = "on" ]; then
l2="Browser: http://${localip}:3000\n"
l3="PasswordB=login / PasswordC=unlock\n"
l4="PasswordA: ssh admin@${localip}"
h=6
fi
if [ "${autoUnlock}" = "on" ]; then
l2="ssh admin@${localip}\n"
l3="Waiting for AUTO-UNLOCK"
fi
boxwidth=$((${#localip} + 26))
dialog --backtitle "RaspiBlitz ${codeVersion} (${localip}) - ${hostname}" --infobox "$l1$l2$l3$l4" ${h} ${boxwidth}
sleep 5
continue
fi
# if LND is syncing or scanning
lndSynced=$(sudo -u bitcoin /usr/local/bin/lncli --chain=${network} --network=${chain}net getinfo 2>/dev/null | jq -r '.synced_to_chain' | grep -c true)
if [ ${lndSynced} -eq 0 ]; then

19
home.admin/80scanLND.sh

@ -4,13 +4,16 @@ source /home/admin/_version.info
source /home/admin/raspiblitz.info
source /mnt/hdd/raspiblitz.conf
# all system/service info gets detected by blitz.statusscan.sh
source <(sudo /home/admin/config.scripts/blitz.statusscan.sh)
# set follow up info different for LCD and ADMIN
adminStr="ssh admin@${localIP} ->Password A"
if [ "$USER" == "admin" ]; then
adminStr="Use CTRL+c to EXIT to Terminal"
fi
# bitcoin errors always first
if [ ${bitcoinActive} -eq 0 ] || [ ${#bitcoinErrorFull} -gt 0 ]; then
####################
@ -51,6 +54,7 @@ if [ ${bitcoinActive} -eq 0 ] || [ ${#bitcoinErrorFull} -gt 0 ]; then
fi
fi
# LND errors second
elif [ ${lndActive} -eq 0 ] || [ ${#lndErrorFull} -gt 0 ]; then
####################
@ -87,6 +91,21 @@ elif [ ${lndActive} -eq 0 ] || [ ${#lndErrorFull} -gt 0 ]; then
fi
fi
# if LND wallet is locked
elif [ ${walletLocked} -gt 1 ]; then
if [ "${autoUnlock}" = "on" ]; then
infoStr=" Waiting for Wallet Auto-Unlock.\n Please wait up to 5min ..."
else
infoStr=" !!! LND WALLET IS LOCKED !!!\n"
if [ "${rtlWebinterface}" = "on" ]; then
height=6
infoStr="${infoStr} Browser: http://${localIP}:3000\n PasswordB=login / PasswordC=unlock"
else
infoStr="${infoStr} Please use SSH to unlock:"
fi
fi
else
####################

8
home.admin/config.scripts/blitz.statusscan.sh

@ -123,6 +123,14 @@ if [ ${lndRunning} -eq 1 ]; then
echo "lndErrorShort=''"
else
# check if wallet is locked
locked=$(echo ${lndinfo} | grep -c unlock)
if [ ${locked} -gt 0 ]; then
echo "walletLocked=1"
else
echo "walletLocked=0"
fi
# synced to chain
syncedToChain=$(echo ${lndinfo} | jq -r '.synced_to_chain' | grep -c 'true')
echo "syncedToChain=${syncedToChain}"

Loading…
Cancel
Save