mirror of
https://github.com/raspiblitz/raspiblitz.git
synced 2025-09-27 12:06:36 +02:00
handle bitcoind not running
This commit is contained in:
@@ -31,8 +31,13 @@ if [ "$1" = "peer-status" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# number of peers connected
|
# number of peers connected
|
||||||
peerNum=$(${network}-cli getnetworkinfo | grep "connections\"" | tr -cd '[[:digit:]]')
|
running=1
|
||||||
result="peers=${peerNum}"
|
peerNum=$(${network}-cli getnetworkinfo 2>/dev/null | grep "connections\"" | tr -cd '[[:digit:]]')
|
||||||
|
if [ "${peerNum}" = "" ]; then
|
||||||
|
running=0
|
||||||
|
peerNum=0
|
||||||
|
fi
|
||||||
|
result="running=${running}\npeers=${peerNum}"
|
||||||
|
|
||||||
# output to cache (normally gets written every 1min by background)
|
# output to cache (normally gets written every 1min by background)
|
||||||
echo "${result}" > /var/cache/raspiblitz/temp/network.monitor.peer-status.cache
|
echo "${result}" > /var/cache/raspiblitz/temp/network.monitor.peer-status.cache
|
||||||
|
Reference in New Issue
Block a user