fix checking string

This commit is contained in:
dima 2013-12-16 20:14:58 +01:00
parent e17ad425b9
commit 50b15b91ee

View File

@ -69,9 +69,7 @@ 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 << "if [ -n $LEASES ]; then"
ip_command << "grep $mac $LEASES | awk '{ print $3 }'"
ip_command << "fi"
ip_command << "[[ $LEASES ]] && grep $mac $LEASES | awk '{ print $3 }'"
conn_attr[:libvirt_ip_command] = ip_command
@logger.info("Connecting to Libvirt (#{uri}) ...")