From 3e9b579ac91c3fecc7b30b4d04e224f459f269a4 Mon Sep 17 00:00:00 2001 From: rootzoll Date: Wed, 18 Dec 2019 12:38:03 +0100 Subject: [PATCH] #123 display Eletrum sync Info on LCD --- home.admin/00infoBlitz.sh | 17 +++++++++++++++++ home.admin/config.scripts/bonus.electrs.sh | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/home.admin/00infoBlitz.sh b/home.admin/00infoBlitz.sh index d46682b8..5191b74e 100755 --- a/home.admin/00infoBlitz.sh +++ b/home.admin/00infoBlitz.sh @@ -324,4 +324,21 @@ elif [ ${#powerFAIL} -gt 0 ] && [ ${powerFAIL} -gt 0 ]; then echo "Weak power supply detected - run 'Hardware Test' in menu" elif [ ${#ups} -gt 1 ] && [ "${upsStatus}" = "n/a" ]; then echo "UPS service activated but not running" +else + + # cheching status of apps and display if in sync or problems + appInfoLine="" + + # Electrum Server - electrs + if [ "${ElectRS}" = "on" ]; then + source <(sudo /home/admin/config.scripts/bonus.eletrs.sh status) + if [ ${isSnyed} -eq 0 ]; then + appInfoLine="Electrum Sync: ${infoSync}" + fi + fi + + if [ ${#appInfoLine} -gt 0 ]; then + echo "${appInfoLine}" + fi + fi \ No newline at end of file diff --git a/home.admin/config.scripts/bonus.electrs.sh b/home.admin/config.scripts/bonus.electrs.sh index 4cea50e5..20645bc2 100644 --- a/home.admin/config.scripts/bonus.electrs.sh +++ b/home.admin/config.scripts/bonus.electrs.sh @@ -31,7 +31,7 @@ if [ "$1" = "status" ]; then if [ ${serviceRunning} -eq 1 ]; then # Experimental try to get sync Info syncedToBlock=$(sudo journalctl -u electrs --no-pager -n100 | grep "new headers from height" | tail -n 1 | cut -d " " -f 16 | sed 's/[^0-9]*//g') - blockchainHeight=$(sudo -u bitcoin ${network}-cli getblockchaininfo 2>/dev/null | jq -r '.blocks' | sed 's/[^0-9]*//g') + blockchainHeight=$(sudo -u bitcoin ${network}-cli getblockchaininfo 2>/dev/null | jq -r '.headers' | sed 's/[^0-9]*//g') if [ "${syncedToBlock}" = "${blockchainHeight}" ]; then echo "isSynced=1" else