Don't reorder config in /etc/network/interfaces
This commit is contained in:
parent
681ba1c3d7
commit
185740163c
|
@ -13,9 +13,8 @@ module VagrantPlugins
|
||||||
machine.communicate.tap do |comm|
|
machine.communicate.tap do |comm|
|
||||||
# First, remove any previous network modifications
|
# First, remove any previous network modifications
|
||||||
# from the interface file.
|
# from the interface file.
|
||||||
comm.sudo("sed -e '/^#VAGRANT-BEGIN/,/^#VAGRANT-END/ d' /etc/network/interfaces > /tmp/vagrant-network-interfaces")
|
comm.sudo("sed -e '/^#VAGRANT-BEGIN/,$ d' /etc/network/interfaces > /tmp/vagrant-network-interfaces.pre")
|
||||||
comm.sudo("su -c 'cat /tmp/vagrant-network-interfaces > /etc/network/interfaces'")
|
comm.sudo("sed -ne '/^#VAGRANT-END/,$ p' /etc/network/interfaces | tail -n +2 > /tmp/vagrant-network-interfaces.post")
|
||||||
comm.sudo("rm -f /tmp/vagrant-network-interfaces")
|
|
||||||
|
|
||||||
# Accumulate the configurations to add to the interfaces file as
|
# Accumulate the configurations to add to the interfaces file as
|
||||||
# well as what interfaces we're actually configuring since we use that
|
# well as what interfaces we're actually configuring since we use that
|
||||||
|
@ -47,8 +46,8 @@ module VagrantPlugins
|
||||||
comm.sudo("/sbin/ip addr flush dev eth#{interface} 2> /dev/null")
|
comm.sudo("/sbin/ip addr flush dev eth#{interface} 2> /dev/null")
|
||||||
end
|
end
|
||||||
|
|
||||||
comm.sudo("cat /tmp/vagrant-network-entry >> /etc/network/interfaces")
|
comm.sudo('cat /tmp/vagrant-network-interfaces.pre /tmp/vagrant-network-entry /tmp/vagrant-network-interfaces.post > /etc/network/interfaces')
|
||||||
comm.sudo("rm -f /tmp/vagrant-network-entry")
|
comm.sudo('rm -f /tmp/vagrant-network-interfaces.pre /tmp/vagrant-network-entry /tmp/vagrant-network-interfaces.post')
|
||||||
|
|
||||||
# Bring back up each network interface, reconfigured
|
# Bring back up each network interface, reconfigured
|
||||||
interfaces.each do |interface|
|
interfaces.each do |interface|
|
||||||
|
|
Loading…
Reference in New Issue