summaryrefslogtreecommitdiffstats
path: root/perl-install/network/netconnect.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install/network/netconnect.pm')
-rw-r--r--perl-install/network/netconnect.pm18
1 files changed, 10 insertions, 8 deletions
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 {