Last active
August 22, 2017 02:05
-
-
Save sheerlox/b213d8cb073ce40b0ecbf1179305d539 to your computer and use it in GitHub Desktop.
Bitcoind synchronization monitor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
clear | |
while true; do | |
BLOCKS=$(bitcoin-cli -datadir=/bitcoin getblockchaininfo | grep 'blocks' | cut -d' ' -f4 | cut -d',' -f1) | |
SYNC=$(bitcoin-cli -datadir=/bitcoin getblockchaininfo | grep 'progress' | cut -d' ' -f4 | cut -d',' -f1) | |
USED=$(df -h | grep bitcoin | sed -e's/ */ /g' | cut -d' ' -f3) | |
TOTAL=$(df -h | grep bitcoin | sed -e's/ */ /g' | cut -d' ' -f2) | |
echo -ne $BLOCKS blocks | |
echo -ne " | " | |
echo -ne $(echo "$SYNC * 100" | bc | cut -c1-5)% | |
echo -ne " | " | |
echo -ne $USED used on $TOTAL \\r | |
sleep 1 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Output:
239180 blocks | 7.578% | 9.6G used on 197G
Adapt the
USED
andTOTAL
grep command for getting the right HDD.