diff options
author | Francois Pons <fpons@mandriva.com> | 2003-02-25 16:47:04 +0000 |
---|---|---|
committer | Francois Pons <fpons@mandriva.com> | 2003-02-25 16:47:04 +0000 |
commit | 088c077da0382c91eae4354a30c14f645264ff7f (patch) | |
tree | cef57382fdb830df94123fda859d49273489970f /perl-install/network | |
parent | 2a8bd94e17d10c6773d87b72dc1b717db7d741a4 (diff) | |
download | drakx-088c077da0382c91eae4354a30c14f645264ff7f.tar drakx-088c077da0382c91eae4354a30c14f645264ff7f.tar.gz drakx-088c077da0382c91eae4354a30c14f645264ff7f.tar.bz2 drakx-088c077da0382c91eae4354a30c14f645264ff7f.tar.xz drakx-088c077da0382c91eae4354a30c14f645264ff7f.zip |
cleaned a bit the code.
Diffstat (limited to 'perl-install/network')
-rw-r--r-- | perl-install/network/adsl.pm | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/perl-install/network/adsl.pm b/perl-install/network/adsl.pm index e712e24f7..4dab50c90 100644 --- a/perl-install/network/adsl.pm +++ b/perl-install/network/adsl.pm @@ -72,22 +72,22 @@ If you don't know, choose 'use pppoe'"), $l) or return; sub adsl_ask_info { my ($adsl, $netc, $_intf, $adsl_type) = @_; my $pppoe_file = "/etc/ppp/pppoe.conf"; - my $pppoe_conf = { getVarsFromSh($pppoe_file) } if $adsl_type =~ /pppoe/ && -f $pppoe_file; - my $login = $pppoe_conf->{USER}; + my %pppoe_conf; %pppoe_conf = getVarsFromSh($pppoe_file) if $adsl_type =~ /pppoe/ && -f $pppoe_file; + my $login = $pppoe_conf{USER}; foreach (qw(/etc/ppp/peers/adsl /etc/ppp/options)) { next if $login && ! -r $_; ($login) = map { if_(/^user\s+\"([^\"]+)\"/, $1) } cat_($_); } - my $passwd = passwd_by_login($pppoe_conf->{USER}); + my $passwd = passwd_by_login($pppoe_conf{USER}); foreach (qw(/etc/ppp/pap-secrets /etc/ppp/chap-secrets)) { next if $passwd && ! -r $_; my $qlogin = quotemeta $login; ($passwd) = map { if_(/^(['"]?)$qlogin\1\s+\S+\s+(['"]?)(\S*)\2/, $3) } cat_($_); } - $pppoe_conf->{DNS1} ||= ''; - $pppoe_conf->{DNS2} ||= ''; - add2hash($netc, { dnsServer2 => $pppoe_conf->{DNS1}, dnsServer3 => $pppoe_conf->{DNS2}, DOMAINNAME2 => '' }); - add2hash($adsl, { login => $user, passwd => $passwd, passwd2 => '' }); + $pppoe_conf{DNS1} ||= ''; + $pppoe_conf{DNS2} ||= ''; + add2hash($netc, { dnsServer2 => $pppoe_conf{DNS1}, dnsServer3 => $pppoe_conf{DNS2}, DOMAINNAME2 => '' }); + add2hash($adsl, { login => $login, passwd => $passwd, passwd2 => '' }); ask_info2($adsl, $netc); } |