aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2017-03-10 14:54:02 -0300
committerSilvio Rhatto <rhatto@riseup.net>2017-03-10 14:54:02 -0300
commit0edde7755d484e874659d74691d304005faa884f (patch)
tree33731bb92c836a5c3d5e78a4add3665eabafd1d6
parent820f12fe0394c2aef8ff5ecbd733f525ef22362a (diff)
downloadkvmx-0edde7755d484e874659d74691d304005faa884f.tar.gz
kvmx-0edde7755d484e874659d74691d304005faa884f.tar.bz2
Better way to wait for the machine to boot
-rwxr-xr-xkvmx8
1 files changed, 6 insertions, 2 deletions
diff --git a/kvmx b/kvmx
index 1dd0302..e1016da 100755
--- a/kvmx
+++ b/kvmx
@@ -115,8 +115,12 @@ function kvmx_up {
kvmx_spice
fi
- echo "Waiting for machine to boot..."
- sleep 5
+ echo -n "Waiting for machine to boot..."
+ while true; do
+ echo true | $SSH_COMMAND -o ConnectTimeout=2 -p $SSH $SSH_LOGIN@127.0.0.1 &> /dev/null && break
+ echo -n "."
+ done
+ echo " done."
# Somehow it is starting before DBUS and then crashing, so we try to start again
echo "Ensure spice-vdagent is running..."