From deb32ddce13f2c1a5ede8e4bd55a5202a1a11cfa Mon Sep 17 00:00:00 2001 From: Brian Pitts Date: Mon, 16 Dec 2013 14:07:40 -0600 Subject: [PATCH] Make ip_command work with posix shells --- lib/vagrant-libvirt/action/connect_libvirt.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/vagrant-libvirt/action/connect_libvirt.rb b/lib/vagrant-libvirt/action/connect_libvirt.rb index e542581..a8ed969 100644 --- a/lib/vagrant-libvirt/action/connect_libvirt.rb +++ b/lib/vagrant-libvirt/action/connect_libvirt.rb @@ -68,8 +68,8 @@ module VagrantPlugins # Setup command for retrieving IP address for newly created machine # with some MAC address. Get it from dnsmasq leases table - ip_command = "LEASES=$(find /var/lib/libvirt/dnsmasq/ /var/lib/misc/ -name '*leases');" - ip_command << "[[ $LEASES ]] && grep $mac $LEASES | awk '{ print $3 }'" + ip_command = %q[ LEASES=$(find /var/lib/libvirt/dnsmasq/ /var/lib/misc/ -name '*leases'); ] + ip_command << %q[ [ -n "$LEASES" ] && grep $mac $LEASES | awk '{ print $3 }' ] conn_attr[:libvirt_ip_command] = ip_command @logger.info("Connecting to Libvirt (#{uri}) ...")