From 0edde7755d484e874659d74691d304005faa884f Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Fri, 10 Mar 2017 14:54:02 -0300 Subject: Better way to wait for the machine to boot --- kvmx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'kvmx') 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..." -- cgit v1.2.3