added finish condition

This commit is contained in:
rootzoll
2019-02-01 14:22:34 +01:00
parent dc3ff2f0ab
commit f033557957

View File

@@ -57,18 +57,15 @@ while [ ${finished} -eq 0 ]
progress=$(echo "${blockchaininfo}" | jq -r '.verificationprogress') progress=$(echo "${blockchaininfo}" | jq -r '.verificationprogress')
#progress=$(echo "${progress}*100" | bc) #progress=$(echo "${progress}*100" | bc)
inprogress="$(echo "${blockchaininfo}" | jq -r '.initialblockdownload')" inprogress="$(echo "${blockchaininfo}" | jq -r '.initialblockdownload')"
if [ "${inprogress}" = "true" ]; then if [ "${inprogress}" = "false" ]; then
finished=1 finished=1
fi fi
echo "" echo ""
echo "RUNNING: ${inprogress}"
echo "PROGRESS: ${progress}" echo "PROGRESS: ${progress}"
echo "running: ${inprogress}"
echo "" echo ""
#TODO: detect and display progress
#TODO: determine when finished and then finished=1
echo "You can close terminal while reindex is running.." echo "You can close terminal while reindex is running.."
echo "But you have to login again to check if ready." echo "But you have to login again to check if ready."
@@ -83,9 +80,14 @@ while [ ${finished} -eq 0 ]
done done
# trigger reboot when finished # trigger reboot when finished
echo "*************************" echo "*************************"
if [ ${finished} -eq 0 ]; then
echo "Re-Index CANCELED"
else
echo "Re-Index finished" echo "Re-Index finished"
fi
echo "Starting reboot ..." echo "Starting reboot ..."
echo "*************************" echo "*************************"
# stop bitcoind # stop bitcoind