From 06515b87f3edcb0b68b6360d09d74550493f28dc Mon Sep 17 00:00:00 2001 From: Kaushal M Date: Wed, 4 Feb 2015 21:05:40 +0530 Subject: [PATCH] Use just awk to parse /proc/net/arp --- lib/vagrant-libvirt/action/connect_libvirt.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/vagrant-libvirt/action/connect_libvirt.rb b/lib/vagrant-libvirt/action/connect_libvirt.rb index e18cfc3..fd5d9d8 100644 --- a/lib/vagrant-libvirt/action/connect_libvirt.rb +++ b/lib/vagrant-libvirt/action/connect_libvirt.rb @@ -30,7 +30,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 = %q[ grep $mac /proc/net/arp | awk '{print $1}' ] + ip_command = %q[ awk "/$mac/ {print \$1}" /proc/net/arp ] conn_attr[:libvirt_ip_command] = ip_command @logger.info("Connecting to Libvirt (#{uri}) ...")