Browse Source

break unlock loop

master
Christian Rotzoll 6 years ago
parent
commit
769e6ddff8
  1. 11
      home.admin/00raspiblitz.sh
  2. 17
      home.admin/80scanLND.sh
  3. 18
      home.admin/config.scripts/blitz.statusscan.sh

11
home.admin/00raspiblitz.sh

@ -239,8 +239,15 @@ To run a BACKUP of funds & channels first is recommended.
# give autounlock 5 min after startup to react
sleep 1
else
/home/admin/AAunlockLND.sh
echo "please wait ... update to next screen can be slow"
# check how many times LND was restarted
source <(sudo /home/admin/config.scripts/blitz.statusscan.sh)
if [ ${startcountLightning} -lt 3 ]; then
/home/admin/AAunlockLND.sh
echo "please wait ... update to next screen can be slow"
else
/home/admin/80scanLND.sh error-report
exit 0
fi
fi
fi
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)

17
home.admin/80scanLND.sh

@ -14,7 +14,7 @@ if [ "$USER" == "admin" ]; then
fi
# bitcoin errors always first
if [ ${bitcoinActive} -eq 0 ] || [ ${#bitcoinErrorFull} -gt 0 ]; then
if [ ${bitcoinActive} -eq 0 ] || [ ${#bitcoinErrorFull} -gt 0 ] || [ "${1}" == "blockchain-error" ]; then
####################
# On Bitcoin Error
@ -23,7 +23,7 @@ if [ ${bitcoinActive} -eq 0 ] || [ ${#bitcoinErrorFull} -gt 0 ]; then
height=5
width=43
title="Blockchain Info"
if [ ${uptime} -gt 600 ]; then
if [ ${uptime} -gt 600 ] || [ "${1}" == "blockchain-error" ]; then
infoStr=" The ${network}d service is not running.\n Login for more details:"
if [ "$USER" == "admin" ]; then
clear
@ -43,11 +43,10 @@ if [ ${bitcoinActive} -eq 0 ] || [ ${#bitcoinErrorFull} -gt 0 ]; then
echo ${bitcoinErrorFull}
echo
fi
echo "-> To start ${network}d run: sudo systemctl start ${network}d"
echo "-> To force Main Menu run: /home/admin/00mainMenu.sh"
echo "-> Use following command to debug: /home/admin/XXdebugLogs.sh"
echo "-> To force Main Menu run: /home/admin/00mainMenu.sh"
echo "-> To try restart: sudo shutdown -r now"
echo ""
exit 1
fi
else
height=6
@ -61,7 +60,7 @@ if [ ${bitcoinActive} -eq 0 ] || [ ${#bitcoinErrorFull} -gt 0 ]; then
fi
# LND errors second
elif [ ${lndActive} -eq 0 ] || [ ${#lndErrorFull} -gt 0 ]; then
elif [ ${lndActive} -eq 0 ] || [ ${#lndErrorFull} -gt 0 ] || [ "${1}" == "lightning-error" ]; then
####################
# On LND Error
@ -70,7 +69,7 @@ elif [ ${lndActive} -eq 0 ] || [ ${#lndErrorFull} -gt 0 ]; then
height=5
width=43
title="Lightning Info"
if [ ${uptime} -gt 600 ]; then
if [ ${uptime} -gt 600 ] || [ "${1}" == "lightning-error" ]; then
infoStr=" The LND service is not running.\n Login for more details:"
if [ "$USER" == "admin" ]; then
clear
@ -90,9 +89,9 @@ elif [ ${lndActive} -eq 0 ] || [ ${#lndErrorFull} -gt 0 ]; then
echo ${lndErrorFull}
echo
fi
echo "-> To start LND run: sudo systemctl start lnd"
echo "-> To force Main Menu run: /home/admin/00mainMenu.sh"
echo "-> Use following command to debug: /home/admin/XXdebugLogs.sh"
echo "-> To force Main Menu run: /home/admin/00mainMenu.sh"
echo "-> To try restart: sudo shutdown -r now"
echo ""
exit 1
fi

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

@ -136,11 +136,23 @@ if [ ${lndRunning} -eq 1 ]; then
else
echo "walletLocked=0"
# if not locked error - then
echo "lndErrorShort='Unkown Error - see logs'"
lndErrorFull=$(echo ${lndErrorFull} | tr -d "'")
rpcNotWorking=$(echo ${lndErrorFull} | greap -c 'connection refused')
if [ ${rpcNotWorking} -gt 0 ]; then
lndErrorShort='LND RPC not responding'
lndErrorFull=$(echo "LND RPC is not responding. LND may have problems starting up. Check logs, config files and systemd service. Org-Error: ${lndErrorFull}" | tr -d "'")
fi
# if not known error - keep generic
if [ ${#lndErrorShort} -eq 0 ]; then
lndErrorShort='Unkown Error - see logs'
lndErrorFull=$(echo ${lndErrorFull} | tr -d "'")
fi
# write to results
echo "lndErrorShort='${lndErrorShort}'"
echo "lndErrorFull='${lndErrorFull}'"
/home/admin/config.scripts/blitz.systemd.sh log lightning "ERROR: ${lndErrorFull}"
fi
else

Loading…
Cancel
Save