summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2002-08-23 10:52:30 +0000
committerPascal Rigaux <pixel@mandriva.com>2002-08-23 10:52:30 +0000
commit0127bb06320f3e3424917ffef0d61ff486a87fad (patch)
treed34445b7db5f26bbe830f3b6d644cc2dca46b07c
parentc89b4b904cc566b7652d2048654275238d6b6396 (diff)
downloaddrakx-backup-do-not-use-0127bb06320f3e3424917ffef0d61ff486a87fad.tar
drakx-backup-do-not-use-0127bb06320f3e3424917ffef0d61ff486a87fad.tar.gz
drakx-backup-do-not-use-0127bb06320f3e3424917ffef0d61ff486a87fad.tar.bz2
drakx-backup-do-not-use-0127bb06320f3e3424917ffef0d61ff486a87fad.tar.xz
drakx-backup-do-not-use-0127bb06320f3e3424917ffef0d61ff486a87fad.zip
(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
-rw-r--r--perl-install/network/netconnect.pm15
1 files changed, 12 insertions, 3 deletions
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 {