diff options
author | Olivier Blin <oblin@mandriva.org> | 2004-08-17 12:05:21 +0000 |
---|---|---|
committer | Olivier Blin <oblin@mandriva.org> | 2004-08-17 12:05:21 +0000 |
commit | 332d925103bf25a304bc17c84f68dc90e93f5514 (patch) | |
tree | c07a9422905654b1e04cdf9f90cd4abe8f76a2ec /perl-install/network | |
parent | 82bfcba1c916d5a35bd75e6bd067701e5b648d2c (diff) | |
download | drakx-332d925103bf25a304bc17c84f68dc90e93f5514.tar drakx-332d925103bf25a304bc17c84f68dc90e93f5514.tar.gz drakx-332d925103bf25a304bc17c84f68dc90e93f5514.tar.bz2 drakx-332d925103bf25a304bc17c84f68dc90e93f5514.tar.xz drakx-332d925103bf25a304bc17c84f68dc90e93f5514.zip |
(easy_dhcp) sort devices and keep only eth[0-9]+ devices
Diffstat (limited to 'perl-install/network')
-rw-r--r-- | perl-install/network/network.pm | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/perl-install/network/network.pm b/perl-install/network/network.pm index b4d06d01e..ea16b36dc 100644 --- a/perl-install/network/network.pm +++ b/perl-install/network/network.pm @@ -365,13 +365,13 @@ sub easy_dhcp { require modules; require network::ethernet; modules::load_category($modules_conf, 'network/main|gigabit|pcmcia|usb'); - my @all_cards = network::ethernet::get_eth_cards($modules_conf); + my @all_dev = sort map { $_->[0] } network::ethernet::get_eth_cards($modules_conf); #- only for a single ethernet network card - my @ether_cards = grep { `LC_ALL= LANG= $::prefix/sbin/ip -o link show $_->[0] 2>/dev/null` =~ m|\slink/ether\s| } @all_cards; - @ether_cards == 1 or return; + 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_cards[0][0]; + my $dhcp_intf = $ether_dev[0]; log::explanations("easy_dhcp: found $dhcp_intf"); network::ethernet::conf_network_card_backend($netc, $intf, 'dhcp', $dhcp_intf); |