diff options
author | Olivier Blin <oblin@mandriva.org> | 2004-08-17 11:03:17 +0000 |
---|---|---|
committer | Olivier Blin <oblin@mandriva.org> | 2004-08-17 11:03:17 +0000 |
commit | 03391c72a47b86459b48496d9368824f3d400d7c (patch) | |
tree | 4686d0f8a00557595b21581c1ca802092d7f2089 /perl-install/network/network.pm | |
parent | d4a9ce9799d18750b85221a3357f48a13547e181 (diff) | |
download | drakx-03391c72a47b86459b48496d9368824f3d400d7c.tar drakx-03391c72a47b86459b48496d9368824f3d400d7c.tar.gz drakx-03391c72a47b86459b48496d9368824f3d400d7c.tar.bz2 drakx-03391c72a47b86459b48496d9368824f3d400d7c.tar.xz drakx-03391c72a47b86459b48496d9368824f3d400d7c.zip |
(easy_dhcp) allow configured interface not to be eth0 and make sure it
uses ethernet
Diffstat (limited to 'perl-install/network/network.pm')
-rw-r--r-- | perl-install/network/network.pm | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/perl-install/network/network.pm b/perl-install/network/network.pm index a5e9bd20b..b4d06d01e 100644 --- a/perl-install/network/network.pm +++ b/perl-install/network/network.pm @@ -367,12 +367,14 @@ sub easy_dhcp { modules::load_category($modules_conf, 'network/main|gigabit|pcmcia|usb'); my @all_cards = network::ethernet::get_eth_cards($modules_conf); - #- only for a single network card - (any { $_->[0] eq 'eth0' } @all_cards) && (every { $_->[0] ne 'eth1' } @all_cards) or return; + #- 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; - log::explanations("easy_dhcp: found eth0"); + my $dhcp_intf = $ether_cards[0][0]; + log::explanations("easy_dhcp: found $dhcp_intf"); - network::ethernet::conf_network_card_backend($netc, $intf, 'dhcp', 'eth0'); + network::ethernet::conf_network_card_backend($netc, $intf, 'dhcp', $dhcp_intf); put_in_hash($netc, { NETWORKING => "yes", |