mynode/rootfs/standard/usr/bin/wait_on_bitcoin.sh

16 lines
365 B
Bash
Raw Normal View History

2019-06-15 23:02:44 +00:00
#!/bin/bash
set -x
set -e
# Wait to see if bitcoin is synced
2019-06-15 23:02:44 +00:00
echo "Checking if Bitcoin is synced..."
while [ ! -f "/mnt/hdd/mynode/.mynode_bitcoin_synced" ]; do
2019-11-04 03:59:43 +00:00
echo "BTC not synced, sleeping 30s"
/bin/sleep 30s
2019-06-15 23:02:44 +00:00
done
# And finally, make sure bitcoin responds to API requests
bitcoin-cli -datadir=/mnt/hdd/mynode/bitcoin -rpcwait getblockchaininfo
2019-06-15 23:02:44 +00:00
exit 0