checking bitcoin running by systemctl

This commit is contained in:
rootzoll 2018-08-24 03:26:57 +02:00
parent b871cd9ed7
commit 35c04f0a4c
2 changed files with 2 additions and 2 deletions

View file

@ -17,7 +17,7 @@ if [ ${mountOK} -eq 1 ]; then
echo "*** Prepare ${network} ***"
sudo killall -u bitcoin
sleep 5
sudo rm -r /home/bitcoin/.${network}
sudo rm -r /home/bitcoin/.${network} 2>/dev/null
sleep 2
if [ -d /home/bitcoin/.${network} ]; then
echo "FAIL - /home/bitcoin/.${network} exists and cannot be removed!"

View file

@ -9,7 +9,7 @@ chain=$(${network}-cli -datadir=/home/bitcoin/.${network} getblockchaininfo | jq
# verify that bitcoin is running
echo "*** Checking ${network} ***"
bitcoinRunning=$(sudo -u bitcoin ${network}-cli getblockchaininfo | grep -c blocks)
bitcoinRunning=$(systemctl status ${network}d.service 2>/dev/null | grep -c running)
if [ ${bitcoinRunning} -eq 0 ]; then
# HDD is not available yet
echo "FAIL - ${network}d is not running"