|
@ -80,12 +80,11 @@ while : |
|
|
# when in presync - get more info on progress |
|
|
# when in presync - get more info on progress |
|
|
elif [ "${state}" = "presync" ]; then |
|
|
elif [ "${state}" = "presync" ]; then |
|
|
# get blockchain sync progress |
|
|
# get blockchain sync progress |
|
|
blockchaininfo="$(sudo -u root bitcoin-cli -conf=/home/admin/assets/bitcoin.conf getblockchaininfo 2>/dev/null)" |
|
|
blockchaininfo="$(sudo -u root ${network}-cli -datadir=/home/bitcoin/.${network} getblockchaininfo 2>/dev/null)" |
|
|
message="starting" |
|
|
message="starting" |
|
|
if [ ${#blockchaininfo} -gt 0 ]; then |
|
|
if [ ${#blockchaininfo} -gt 0 ]; then |
|
|
message="$(echo "${blockchaininfo}" | jq -r '.verificationprogress')" |
|
|
message="$(echo "${blockchaininfo}" | jq -r '.verificationprogress')" |
|
|
message=$(echo "${message}*100" | bc) |
|
|
message=$(echo $message | awk '{printf( "%.2f%%", 100 * $1)}') |
|
|
message="${message}%" |
|
|
|
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|
# when old data - improve message |
|
|
# when old data - improve message |
|
|