Switch to using ifconfig <device> down instead of ifdown. ifdown will return non-zero status if device failed to get IP during dhcp.

This commit is contained in:
Ryan Gibbons 2012-01-18 10:43:14 -07:00 committed by Mitchell Hashimoto
parent cc94f1ee2c
commit a11e99cdae
1 changed files with 1 additions and 1 deletions

View File

@ -39,7 +39,7 @@ module Vagrant
# each specifically, we avoid reconfiguring eth0 (the NAT interface) so
# SSH never dies.
interfaces.each do |interface|
vm.channel.sudo("/sbin/ifdown eth#{interface} 2> /dev/null")
vm.channel.sudo("/sbin/ifconfig eth#{interface} down 2> /dev/null")
vm.channel.sudo("cat /tmp/vagrant-network-entry_#{interface} >> #{network_scripts_dir}/ifcfg-eth#{interface}")
vm.channel.sudo("/sbin/ifup eth#{interface}")
end