mirror of
https://github.com/bisq-network/bisq.git
synced 2024-11-19 09:52:23 +01: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"
|