mirror of
https://github.com/rootzoll/raspiblitz.git
synced 2025-02-25 07:07:46 +01:00
handle bitcoind not running
This commit is contained in:
parent
b59e1f6b1c
commit
89f8605568
1 changed files with 7 additions and 2 deletions
|
@ -31,8 +31,13 @@ if [ "$1" = "peer-status" ]; then
|
|||
fi
|
||||
|
||||
# number of peers connected
|
||||
peerNum=$(${network}-cli getnetworkinfo | grep "connections\"" | tr -cd '[[:digit:]]')
|
||||
result="peers=${peerNum}"
|
||||
running=1
|
||||
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)
|
||||
echo "${result}" > /var/cache/raspiblitz/temp/network.monitor.peer-status.cache
|
||||
|
|
Loading…
Add table
Reference in a new issue