Skip to content

Commit

Permalink
Merge pull request #5 from ricardson/patch-1
Browse files Browse the repository at this point in the history
changes deprecat "ifconfig" to new "ip" command
  • Loading branch information
rogeriopradoj committed May 7, 2016
2 parents d062bea + 06c2d88 commit 729abd4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/vagrant-ip-show/command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def execute
with_target_vms(argv, single_target: true) do |vm|
@logger.info("Getting ips of vm networks")
ssh_opts = {extra_args: ['-q']} # make it quiet
env = vm.action(:ssh_run, ssh_run_command: "/sbin/ifconfig | grep 'inet addr:' | grep -v 127.0.0.1 | sed -e 's/Bcast//' | cut -d: -f2", ssh_opts: ssh_opts)
env = vm.action(:ssh_run, ssh_run_command: "ip a | grep 'inet ' | awk '{ print $2}' | grep -v 127.0.0.1 | cut -d/ -f1", ssh_opts: ssh_opts)
status = env[:ssh_run_exit_status] || 0
return status
end
Expand Down

0 comments on commit 729abd4

Please sign in to comment.