[libvirt] [PATCH] libvirt-guests: avoid bashism

Peter Krempa pkrempa at redhat.com
Mon Apr 7 09:25:07 UTC 2014


On 04/07/14 11:20, Guido Günther wrote:
> At least Debian uses dash to run the init scripts
> ---
>  tools/libvirt-guests.sh.in | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/libvirt-guests.sh.in b/tools/libvirt-guests.sh.in
> index 4bbd4e4..a158b62 100644
> --- a/tools/libvirt-guests.sh.in
> +++ b/tools/libvirt-guests.sh.in
> @@ -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
> 

ACK,

Peter

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 901 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20140407/f395c397/attachment-0001.sig>


More information about the libvir-list mailing list