Merge pull request #686 from epienbroek/nfs_ip

Use /sbin/ip when there is no 'ip' command in any of the default PATHs
This commit is contained in:
Dmitry Vasilets 2016-11-02 18:25:12 +01:00 committed by GitHub
commit 0db148dcbe

View File

@ -59,7 +59,7 @@ module VagrantPlugins
return ssh_host if ping(ssh_host)
# check other ips
command = "ip addr show | grep -i 'inet ' | grep -v '127.0.0.1' | tr -s ' ' | cut -d' ' -f3 | cut -d'/' -f 1"
command = "ip=$(which ip); ${ip:-/sbin/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