improved bitcoind waiting

This commit is contained in:
rootzoll
2018-12-10 16:31:09 +01:00
parent cc35043b68
commit eafc7b6981
2 changed files with 21 additions and 16 deletions

View File

@@ -44,10 +44,8 @@ if [ ${mountOK} -eq 1 ]; then
sudo systemctl daemon-reload
sudo systemctl enable ${network}d.service
sudo systemctl start ${network}d.service
echo "Giving ${network}d service 180 seconds to init - please wait ..."
sleep 180
echo "OK - ${network}d started"
sleep 2
echo "Started ... wait 10 secs"
sleep 10
# set SetupState
sudo sed -i "s/^setupStep=.*/setupStep=60/g" /home/admin/raspiblitz.info

View File

@@ -22,25 +22,32 @@ echo ""
# verify that chainnetwork is ready
chainIsReady=0
loopCount=0
echo "*** Wait until ${network}d is ready ..."
while [ ${chainIsReady} -eq 0 ]
do
echo "*** Test if chainnetwork is ready ..."
date +%s
loopCount=$(($loopCount +1))
result=$(${network}-cli getblockchaininfo 2>error.out)
error=`cat error.out`
rm error.out
echo "result(${result})"
echo "error(${error})"
if [ ${#error} -gt 0 ]; then
testnetAdd=""
if [ "${chain}" = "test" ]; then
testnetAdd="testnet3/"
if [ ${loopCount} -gt 33]; then
echo "*** TAKES LONGER THEN EXCEPTED ***"
date +%s
echo "result(${result})"
echo "error(${error})"
testnetAdd=""
if [ "${chain}" = "test" ]; then
testnetAdd="testnet3/"
fi
sudo tail -n 5 /mnt/hdd/${network}/${testnetAdd}debug.log
echo "If you see an error -28 relax, just give it some time."
echo "Waiting 1 minute and then trying again ..."
sleep 60
else
echo "(${loopCount}/33) still waiting .."
sleep 10
fi
sudo tail -n 5 /mnt/hdd/${network}/${testnetAdd}debug.log
echo "If you see an error -28 relax, just give it some time."
echo "Waiting 1 minute and then trying again ..."
sleep 60
echo ""
else
echo "OK - chainnetwork is working"
echo ""