monitor progress

This commit is contained in:
rootzoll 2019-02-01 13:58:44 +01:00
parent e976e34e3d
commit 7677f655cf

View File

@ -41,6 +41,7 @@ fi
# while loop to wait to finish
finished=0
progress=0
while [ ${finished} -eq 0 ]
do
clear
@ -51,9 +52,13 @@ while [ ${finished} -eq 0 ]
echo "THIS CAN TAKE SOME LONG TIME"
echo "If you dont see any progress after 24h keep X pressed to stop."
progress=0
# get blockchain sync progress
blockchaininfo=$(sudo -u bitcoin ${network}-cli -datadir=/home/bitcoin/.${network} getblockchaininfo)
progress="$(echo "${blockchaininfo}" | jq -r '.verificationprogress')"
progress=$(echo "${progress}*100" | bc)
echo ""
echo "PROGRESS: ${progress}%"
echo "PROGRESS: ${progress}"
echo ""
#TODO: detect and display progress