From 6ffad6104f4b396ec327299582dad6b4e8c69aa6 Mon Sep 17 00:00:00 2001 From: Shuanglei Tao Date: Sun, 17 May 2015 19:59:17 +0800 Subject: [PATCH] Replace ifconfig with ip addr --- lib/vagrant-libvirt/action/prepare_nfs_settings.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/vagrant-libvirt/action/prepare_nfs_settings.rb b/lib/vagrant-libvirt/action/prepare_nfs_settings.rb index 1935660..0f9b796 100644 --- a/lib/vagrant-libvirt/action/prepare_nfs_settings.rb +++ b/lib/vagrant-libvirt/action/prepare_nfs_settings.rb @@ -56,7 +56,7 @@ module VagrantPlugins return ssh_host if ping(ssh_host) # check other ips - command = "LANG=en ifconfig |grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1 }'" + command = "ip addr show | grep -i 'inet ' | grep -v '127.0.0.1' | tr -s ' ' | cut -d' ' -f3 | cut -d'/' -f 1" result = "" machine.communicate.execute(command) do |type, data| result << data if type == :stdout