From a0041a1aebdae0d5042f3c1e156f541275cb1b61 Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Fri, 3 Sep 2004 06:01:39 +0000 Subject: (findIntf, read_all_conf) use default DEVICE field only at last ressort, keep weird DEVICE fiels (i.e for sagem) --- perl-install/network/network.pm | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'perl-install/network') diff --git a/perl-install/network/network.pm b/perl-install/network/network.pm index 0277dc1eb..6e7d2afff 100644 --- a/perl-install/network/network.pm +++ b/perl-install/network/network.pm @@ -231,7 +231,7 @@ sub dnsServers { sub findIntf { my ($intf, $device) = @_; - $intf->{$device}{DEVICE} = $device; + $intf->{$device}{DEVICE} = undef; $intf->{$device}; } @@ -338,10 +338,12 @@ sub read_all_conf { add2hash($netc, read_resolv_conf()); add2hash($netc, read_tmdns_conf()); foreach (all("$::prefix/etc/sysconfig/network-scripts")) { - if (/^ifcfg-([A-Za-z0-9.:]+)$/ && $1 ne 'lo') { - my $intf = findIntf($intf, $1); + my ($device) = /^ifcfg-([A-Za-z0-9.:]+)$/; + if ($device && $device ne 'lo') { + my $intf = findIntf($intf, $device); add2hash($intf, { getVarsFromSh("$::prefix/etc/sysconfig/network-scripts/$_") }); - $intf->{WIRELESS_ENC_KEY} = network::tools::get_wep_key_from_iwconfig($intf->{WIRELESS_ENC_KEY}); + $intf->{DEVICE} ||= $device; + $intf->{WIRELESS_ENC_KEY} = network::tools::get_wep_key_from_iwconfig($intf->{WIRELESS_ENC_KEY}); } } $netcnx->{type} or probe_netcnx_type($::prefix, $netc, $intf, $netcnx); -- cgit v1.2.1