diff options
author | Olivier Blin <oblin@mandriva.com> | 2010-04-30 13:31:34 +0000 |
---|---|---|
committer | Olivier Blin <oblin@mandriva.com> | 2010-04-30 13:31:34 +0000 |
commit | 97230ea3bccd5d6a318b9b94f03e163abba26e03 (patch) | |
tree | 600820e95a9da646aa7a2c3366cb34a7e0184bc1 /lib/network/network.pm | |
parent | 651b1d7697c58e7b275b161a8cdde697ff170949 (diff) | |
download | drakx-net-97230ea3bccd5d6a318b9b94f03e163abba26e03.tar drakx-net-97230ea3bccd5d6a318b9b94f03e163abba26e03.tar.gz drakx-net-97230ea3bccd5d6a318b9b94f03e163abba26e03.tar.bz2 drakx-net-97230ea3bccd5d6a318b9b94f03e163abba26e03.tar.xz drakx-net-97230ea3bccd5d6a318b9b94f03e163abba26e03.zip |
installer: configure automatic DHCP on all ethernet interfaces
(and not just if there is a unique ethernet interface)
Diffstat (limited to 'lib/network/network.pm')
-rw-r--r-- | lib/network/network.pm | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/lib/network/network.pm b/lib/network/network.pm index 307b5b9..f88939b 100644 --- a/lib/network/network.pm +++ b/lib/network/network.pm @@ -779,20 +779,17 @@ sub easy_dhcp { modules::load_category($modules_conf, list_modules::ethernet_categories()); my @all_dev = sort map { $_->[0] } network::connection::ethernet::get_eth_cards($modules_conf); - #- only for a single ethernet network card my @ether_dev = grep { /^eth[0-9]+$/ && `LC_ALL= LANG= $::prefix/sbin/ip -o link show $_ 2>/dev/null` =~ m|\slink/ether\s| } @all_dev; - @ether_dev == 1 or return; - - my $dhcp_intf = $ether_dev[0]; - log::explanations("easy_dhcp: found $dhcp_intf"); - - $net->{ifcfg}{$dhcp_intf} ||= {}; - put_in_hash($net->{ifcfg}{$dhcp_intf}, { + foreach my $dhcp_intf (@ether_dev) { + log::explanations("easy_dhcp: found $dhcp_intf"); + $net->{ifcfg}{$dhcp_intf} ||= {}; + put_in_hash($net->{ifcfg}{$dhcp_intf}, { DEVICE => $dhcp_intf, BOOTPROTO => 'dhcp', NETMASK => '255.255.255.0', ONBOOT => 'yes' - }); + }); + } 1; } |