#123 display Eletrum sync Info on LCD

This commit is contained in:
rootzoll 2019-12-18 12:38:03 +01:00
parent 2dc466c599
commit 3e9b579ac9
2 changed files with 18 additions and 1 deletions

View File

@ -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

View File

@ -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