From 0127bb06320f3e3424917ffef0d61ff486a87fad Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Fri, 23 Aug 2002 10:52:30 +0000 Subject: (read_raw_net_conf): new function to access /etc/sysconfig/drakconnect and /etc/sysconfig/drakconnect.$type ensuring migration from /etc/sysconfig/draknet and /etc/sysconfig/draknet.$type --- perl-install/network/netconnect.pm | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'perl-install') diff --git a/perl-install/network/netconnect.pm b/perl-install/network/netconnect.pm index 0f6bb1d80..7d7464872 100644 --- a/perl-install/network/netconnect.pm +++ b/perl-install/network/netconnect.pm @@ -591,16 +591,25 @@ sub load_conf { } } +#- ensures the migration from old config files +sub read_raw_net_conf { + my ($suffix) = @_; + my $dir = "$::prefix/etc/sysconfig"; + $suffix = $suffix ? ".$suffix" : ''; + rename "$dir/draknet$suffix", "$dir/drakconnect$suffix"; + getVarsFromSh("$dir/drakconnect$suffix"); +} + sub get_net_device { - ${{ getVarsFromSh("/etc/sysconfig/drakconnect") }}{NET_DEVICE}; + ${{ read_raw_net_conf() }}{NET_DEVICE}; } sub read_net_conf { my ($prefix, $netcnx, $netc)=@_; - add2hash($netcnx, { getVarsFromSh("$prefix/etc/sysconfig/drakconnect") }); + add2hash($netcnx, { read_raw_net_conf() }); $netc->{$_} = $netcnx->{$_} foreach 'NET_DEVICE', 'NET_INTERFACE'; $netcnx->{$netcnx->{type}}||={}; - add2hash($netcnx->{$netcnx->{type}}, { getVarsFromSh("$prefix/etc/sysconfig/drakconnect." . $netcnx->{type}) }); + add2hash($netcnx->{$netcnx->{type}}, { read_raw_net_conf($netcnx->{type}) }); } sub set_net_conf { -- cgit v1.2.1