From f90f15ec4cc14d76e65bdc52957a302018ff2c66 Mon Sep 17 00:00:00 2001 From: frennkie Date: Mon, 20 Jul 2020 16:57:06 +0100 Subject: [PATCH] quick fix for infoBitz LND sync progress --- home.admin/00infoBlitz.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/home.admin/00infoBlitz.sh b/home.admin/00infoBlitz.sh index 76eb117a9..16ef6bbb2 100755 --- a/home.admin/00infoBlitz.sh +++ b/home.admin/00infoBlitz.sh @@ -88,7 +88,7 @@ fi network_active_if=$(ip addr | grep -v "lo:" | grep 'state UP' | tr -d " " | cut -d ":" -f2 | head -n 1) # get network traffic -# ifconfig does not show eth0 on Armbian or in a VM - get first traffic info +# ifconfig does not show eth0 on Armbian or in a VM - get first traffic info isArmbian=$(cat /etc/os-release 2>/dev/null | grep -c 'Debian') if [ ${isArmbian} -gt 0 ] || [ ! -d "/sys/class/thermal/thermal_zone0/" ]; then network_rx=$(ifconfig | grep -m1 'RX packets' | awk '{ print $6$7 }' | sed 's/[()]//g') @@ -268,7 +268,10 @@ else if [ ${#ln_getInfo} -eq 0 ]; then ln_baseInfo="${color_red} Not Started | Not Ready Yet" else - item=$(sudo -u bitcoin tail -n 100 /mnt/hdd/lnd/logs/${network}/${chain}net/lnd.log 2> /dev/null | grep "(height" | tail -n1 | awk '{print $10} {print $11} {print $12}' | tr -dc '0-9') + item=$(sudo -u bitcoin tail -n 100 /mnt/hdd/lnd/logs/${network}/${chain}net/lnd.log 2> /dev/null | grep "Filtering block" | tail -n1 | awk '{print $7}') + if [ ${#item} -eq 0 ]; then + item=$(sudo -u bitcoin tail -n 100 /mnt/hdd/lnd/logs/${network}/${chain}net/lnd.log 2> /dev/null | grep "(height" | tail -n1 | awk '{print $10} {print $11} {print $12}' | tr -dc '0-9') + fi total=$(sudo -u bitcoin ${network}-cli -datadir=/home/bitcoin/.${network} getblockchaininfo 2>/dev/null | jq -r '.blocks') ln_baseInfo="${color_red} waiting for chain sync" if [ ${#item} -gt 0 ]; then @@ -358,7 +361,7 @@ else if [ ${#appInfoLine} -gt 0 ]; then echo "${appInfoLine}" fi - + fi uptime=$(uptime --pretty) @@ -417,4 +420,4 @@ EOF fi fi -# EOF \ No newline at end of file +# EOF