From 623e1309b716624dceff13a4b16814af77f63234 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Tue, 20 Jan 2004 11:10:47 +0000 Subject: keep entered data when stepping back to dialup options step --- perl-install/network/netconnect.pm | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'perl-install/network') diff --git a/perl-install/network/netconnect.pm b/perl-install/network/netconnect.pm index 348bf1229..f5c777a9a 100644 --- a/perl-install/network/netconnect.pm +++ b/perl-install/network/netconnect.pm @@ -426,25 +426,27 @@ Take a look at http://www.linmodems.org"), q(ifdown ppp0 killall pppd ), $netcnx->{type}); - $modem = $netcnx->{$netcnx->{type}}; - $modem->{device} = $first_modem->()->{device}; + $netcnx->{$netcnx->{type}} ||= {}; + $modem ||= $netcnx->{$netcnx->{type}}; + $modem->{device} ||= $first_modem->()->{device}; my %l = getVarsFromSh("$::prefix/usr/share/config/kppprc"); - $modem->{connection} = $l{Name}; - $modem->{domain} = $l{Domain}; - ($modem->{dns1}, $modem->{dns2}) = split(',', $l{DNS}); + $modem->{connection} ||= $l{Name}; + $modem->{domain} ||= $l{Domain}; + ($modem->{dns1}, $modem->{dns2}) ||= split(',', $l{DNS}); foreach (cat_("/etc/sysconfig/network-scripts/chat-ppp0")) { - /.*ATDT(\d*)/ and $modem->{phone} = $1; + /.*ATDT(\d*)/ and $modem->{phone} ||= $1; } foreach (cat_("/etc/sysconfig/network-scripts/ifcfg-ppp0")) { - /NAME=(['"]?)(.*)\1/ and $modem->{login} = $2; + /NAME=(['"]?)(.*)\1/ and $modem->{login} ||= $2; } my $secret = network::tools::read_secret_backend(); foreach (@$secret) { - $modem->{passwd} = $_->{passwd} if $_->{login} eq $modem->{login}; + $modem->{passwd} ||= $_->{passwd} if $_->{login} eq $modem->{login}; } #my $secret = network::tools::read_secret_backend(); #my @cnx_list = map { $_->{server} } @$secret; + $modem->{$_} ||= '' foreach qw(connection phone login passwd auth domain dns1 dns2); }, name => N("Dialup options"), data => sub { -- cgit v1.2.1