examples/deploy-qemu-vm: show progress when waiting

This improves the user experience on VM startup, which can take a few
seconds.
This commit is contained in:
Erik Arvstedt
2021-03-08 15:11:16 +01:00
committed by Jonas Nick
parent ccba86a0f0
commit 908af3bfb8
3 changed files with 31 additions and 9 deletions

View File

@@ -38,14 +38,13 @@ sshPort=60734
runVM $tmpDir/vm $vmNumCPUs $vmMemoryMiB $sshPort
vmWaitForSSH
echo "Waiting until services are ready..."
c '
attempts=300
while ! systemctl is-active clightning &> /dev/null; do
((attempts-- == 0)) && { echo "timeout"; exit 1; }
sleep 0.2
done
'
printf "Waiting until services are ready"
c "
$(cat qemu-vm/wait-until.sh)
waitUntil 'systemctl is-active clightning &> /dev/null' 100
"
echo
echo
echo "Bitcoind service:"
c systemctl status bitcoind