]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
libvirt-guests: avoid bashism
authorGuido Günther <agx@sigxcpu.org>
Mon, 7 Apr 2014 09:11:07 +0000 (11:11 +0200)
committerGuido Günther <agx@sigxcpu.org>
Mon, 7 Apr 2014 10:51:05 +0000 (12:51 +0200)
At least Debian uses dash to run the init scripts

tools/libvirt-guests.sh.in

index 4bbd4e4d87757a6d7b2cc480a9a6cd7f7bd71fba..a158b62dcdbef0fa5c04e9c71781b1f98927adc0 100644 (file)
@@ -89,13 +89,15 @@ test_connect()
 {
     uri=$1
 
-    for ((i = 0; i < ${CONNECT_RETRIES}; i++)); do
+    i=${CONNECT_RETRIES}
+    while [ $i -gt 0 ]; do
         run_virsh "$uri" connect 2>/dev/null
         if [ $? -eq 0 ]; then
             return 0;
         fi
         sleep ${RETRIES_SLEEP}
         eval_gettext "Unable to connect to libvirt currently. Retrying .. \$i"
+        i=$(($i-1))
     done
     eval_gettext "Can't connect to \$uri. Skipping."
     echo