mirror of
https://github.com/haveno-dex/haveno.git
synced 2024-10-01 01:35:48 -04:00
26 lines
530 B
Bash
Executable File
26 lines
530 B
Bash
Executable File
#!/bin/bash
|
|
|
|
function is_connected(){
|
|
sleep 1
|
|
blocks=$(bitcoin-cli -datadir=. -regtest getblockcount)
|
|
if [ $? -eq 0 ];then
|
|
echo "yes"
|
|
else
|
|
echo "no"
|
|
fi
|
|
}
|
|
|
|
connected=$(is_connected)
|
|
until [ "$connected" == "yes" ];do
|
|
connected=$(is_connected)
|
|
done
|
|
|
|
blocks=$(bitcoin-cli -datadir=. -regtest getblockcount)
|
|
if [ $? -eq 0 ] && [ $blocks -lt 101 ];then
|
|
echo "$0: found less blocks then 101, generating ..."
|
|
bitcoin-cli -datadir=. -regtest generate 101
|
|
echo "$0: done, exiting"
|
|
exit 0
|
|
fi
|
|
echo "$0: nothing to do, exiting"
|