mirror of
https://github.com/rootzoll/raspiblitz.git
synced 2024-11-20 18:22:01 +01:00
allow sudo call
This commit is contained in:
parent
c02b2ad8cc
commit
83c2f042ae
@ -217,9 +217,9 @@ do
|
||||
# check every 1min
|
||||
recheckSync=$(($counter % 60))
|
||||
if [ ${recheckSync} -eq 1 ]; then
|
||||
source <(sudo -u admin /home/admin/config.scripts/network.monitor.sh peer-status)
|
||||
source <(sudo /home/admin/config.scripts/network.monitor.sh peer-status)
|
||||
echo "Blockchain Sync Monitoring: peers=${peers}"
|
||||
if [ "${peers}" == "0" ]; then
|
||||
if [ "${peers}" == "0" ] && [ "${running}" == "1" ]; then
|
||||
echo "Blockchain Sync Monitoring: ZERO PEERS DETECTED .. doing out-of-band kickstart"
|
||||
sudo /home/admin/config.scripts/network.monitor.sh peer-kickstart
|
||||
fi
|
||||
|
@ -32,7 +32,13 @@ if [ "$1" = "peer-status" ]; then
|
||||
|
||||
# number of peers connected
|
||||
running=1
|
||||
peerNum=$(${network}-cli getnetworkinfo 2>/dev/null | grep "connections\"" | tr -cd '[[:digit:]]')
|
||||
if [ "$EUID" -eq 0 ]; then
|
||||
# sudo call
|
||||
peerNum=$(sudo -u admin ${network}-cli getnetworkinfo 2>/dev/null | grep "connections\"" | tr -cd '[[:digit:]]')
|
||||
else
|
||||
# user call
|
||||
peerNum=$(${network}-cli getnetworkinfo 2>/dev/null | grep "connections\"" | tr -cd '[[:digit:]]')
|
||||
fi
|
||||
if [ "${peerNum}" = "" ]; then
|
||||
running=0
|
||||
peerNum=0
|
||||
|
Loading…
Reference in New Issue
Block a user