From: Silvio Rhatto Date: Fri, 10 Mar 2017 17:54:02 +0000 (-0300) Subject: Better way to wait for the machine to boot X-Git-Tag: 0.1.0~563 X-Git-Url: https://gitweb.fluxo.info/?a=commitdiff_plain;h=0edde7755d484e874659d74691d304005faa884f;p=kvmx.git Better way to wait for the machine to boot --- 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..."