Make ip_command work with posix shells

This commit is contained in:
Brian Pitts 2013-12-16 14:07:40 -06:00
parent 50b15b91ee
commit deb32ddce1

View File

@ -68,8 +68,8 @@ module VagrantPlugins
# Setup command for retrieving IP address for newly created machine # Setup command for retrieving IP address for newly created machine
# with some MAC address. Get it from dnsmasq leases table # 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 = %q[ LEASES=$(find /var/lib/libvirt/dnsmasq/ /var/lib/misc/ -name '*leases'); ]
ip_command << "[[ $LEASES ]] && grep $mac $LEASES | awk '{ print $3 }'" ip_command << %q[ [ -n "$LEASES" ] && grep $mac $LEASES | awk '{ print $3 }' ]
conn_attr[:libvirt_ip_command] = ip_command conn_attr[:libvirt_ip_command] = ip_command
@logger.info("Connecting to Libvirt (#{uri}) ...") @logger.info("Connecting to Libvirt (#{uri}) ...")