Add support for DHCP on tinycore
This commit is contained in:
parent
ba994baa65
commit
70fece7a99
|
@ -7,6 +7,11 @@ module VagrantPlugins
|
|||
def self.configure_networks(machine, networks)
|
||||
machine.communicate.tap do |comm|
|
||||
networks.each do |n|
|
||||
if n[:type] == :dhcp
|
||||
comm.sudo("/sbin/udhcpc -b -i eth#{n[:interface]} -p /var/run/udhcpc.eth#{n[:interface]}.pid")
|
||||
return
|
||||
end
|
||||
|
||||
ifc = "/sbin/ifconfig eth#{n[:interface]}"
|
||||
broadcast = (IPAddr.new(n[:ip]) | (~ IPAddr.new(n[:netmask]))).to_s
|
||||
comm.sudo("#{ifc} down")
|
||||
|
|
Loading…
Reference in New Issue