From 80de4054c66e4083055a1f7148eda4b7e831c8db Mon Sep 17 00:00:00 2001 From: Candle <50766841+CandleHater@users.noreply.github.com> Date: Thu, 27 Aug 2020 17:44:56 +0000 Subject: [PATCH 1/2] Improves "service is not running" error upon boot There's an issue regarding a falsely reported error (service is not running) upon boot if the bitcoind service hasn't finished warming up within 10min after boot. This PR fixes that problem by checking if the variable `bitcoinErrorFull` contains the error code -28, after the 10min threshold has been surpassed. --- home.admin/80scanLND.sh | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/home.admin/80scanLND.sh b/home.admin/80scanLND.sh index dc833a7d7..91cb41085 100755 --- a/home.admin/80scanLND.sh +++ b/home.admin/80scanLND.sh @@ -63,9 +63,11 @@ if [ ${bitcoinActive} -eq 0 ] || [ ${#bitcoinErrorFull} -gt 0 ] || [ "${1}" == " else # output when user login in as admin and bitcoind is not running - - if [ ${uptime} -gt 600 ] || [ ${#bitcoinErrorFull} -gt 0 ] || [ "${bitcoinErrorShort}" == "Error found in Logs" ] || [ "${1}" == "blockchain-error" ]; then - + if [ ${uptime} -lt 600 ]; then + infoStr=" The ${network}d service is starting:\n ${bitcoinErrorShort}\n Please wait at least 10min ..." + elif [[ "${bitcoinErrorFull}" == *"error code: -28"* ]]; then + infoStr=" The ${network}d service is warming up:\n ${bitcoinErrorShort}\n Please wait ..." + elif [ ${#bitcoinErrorFull} -gt 0 ] || [ "${bitcoinErrorShort}" == "Error found in Logs" ] || [ "${1}" == "blockchain-error" ]; then clear echo "" echo "*****************************************" @@ -95,9 +97,6 @@ if [ ${bitcoinActive} -eq 0 ] || [ ${#bitcoinErrorFull} -gt 0 ] || [ "${1}" == " echo "-> Have you tried to turn it off and on again? Use command 'restart'" echo "" exit 1 - - else - infoStr=" The ${network}d service is starting:\n ${bitcoinErrorShort}\n Please wait up to 10min ..." fi fi @@ -114,7 +113,7 @@ elif [ ${lndActive} -eq 0 ] || [ ${#lndErrorFull} -gt 0 ] || [ "${1}" == "lightn title="Lightning Info" if [ ${uptime} -gt 600 ] || [ "${1}" == "lightning-error" ]; then if [ ${#lndErrorShort} -gt 0 ]; then - height=6 + height=6 lndErrorShort=" ${lndErrorShort}\n" fi if [ ${lndActive} -eq 0 ]; then @@ -216,7 +215,6 @@ else syncProgress="${syncProgress} %" fi - # formatting LIGHTNING SCAN PROGRESS if [ ${#scanProgress} -eq 0 ]; then From a9261fa3aac3c9f14709388bd51ad95722ee91e9 Mon Sep 17 00:00:00 2001 From: ChuckNorrison <2964146+ChuckNorrison@users.noreply.github.com> Date: Sat, 5 Sep 2020 22:14:58 +0200 Subject: [PATCH 2/2] use 'ip route get' over 'ip addr' for interface check (#1478) use ip route get over ip addr for interface check --- home.admin/00infoBlitz.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/home.admin/00infoBlitz.sh b/home.admin/00infoBlitz.sh index c1f3e434c..8492be95c 100755 --- a/home.admin/00infoBlitz.sh +++ b/home.admin/00infoBlitz.sh @@ -85,7 +85,7 @@ else fi # get name of active interface (eth0 or wlan0) -network_active_if=$(ip addr | grep -v "lo:" | grep 'state UP' | tr -d " " | cut -d ":" -f2 | head -n 1) +network_active_if=$(ip route get 255.255.255.255 | awk -- '{print $4}' | head -n 1) # get network traffic # ifconfig does not show eth0 on Armbian or in a VM - get first traffic info