Class: VagrantPlugins::GuestQNX::Cap::ConfigureNetworks

Inherits:
Object
  • Object
show all
Defined in:
lib/qnx/vagrant/cap/configure_networks.rb

Class Method Summary collapse

Class Method Details

.configure_networks(machine, networks) ⇒ Object



5
6
7
8
9
10
11
12
13
14
# File 'lib/qnx/vagrant/cap/configure_networks.rb', line 5

def self.configure_networks(machine,networks)
 	machine.ui.warn("networking")
	networks.each do |network|
    if network[:type].to_sym == :static
      machine.communicate.execute("su -c - \"ifconfig wm#{network[:interface]} inet #{network[:ip]} netmask #{network[:netmask]}\"")
    elsif network[:type].to_sym == :dhcp
      machine.communicate.execute("su -c - \"dhcp.client -i wm#{network[:interface]}\"")
    end
  end
end