]> gitweb.fluxo.info Git - kvmx.git/commitdiff
Better way to wait for the machine to boot
authorSilvio Rhatto <rhatto@riseup.net>
Fri, 10 Mar 2017 17:54:02 +0000 (14:54 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Fri, 10 Mar 2017 17:54:02 +0000 (14:54 -0300)
kvmx

diff --git a/kvmx b/kvmx
index 1dd03028b3d53de0145c18eabf381667b8615778..e1016da98e484e7439bc93cfa0428ede6d300124 100755 (executable)
--- 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..."