mirror of
https://github.com/raspiblitz/raspiblitz.git
synced 2025-10-02 12:12:51 +02:00
#123 display Eletrum sync Info on LCD
This commit is contained in:
@@ -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
|
@@ -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
|
||||
|
Reference in New Issue
Block a user