summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>2003-03-11 15:17:41 +0000
committerFrancois Pons <fpons@mandriva.com>2003-03-11 15:17:41 +0000
commit40691a6bac8382e825fcb6549cae4d7704ca5c15 (patch)
tree48d5d6c739b5e7d90fa71271a47f5d53151c88d2
parent44852e176d71e037fa6f008426d4e573741a5f3d (diff)
downloaddrakx-40691a6bac8382e825fcb6549cae4d7704ca5c15.tar
drakx-40691a6bac8382e825fcb6549cae4d7704ca5c15.tar.gz
drakx-40691a6bac8382e825fcb6549cae4d7704ca5c15.tar.bz2
drakx-40691a6bac8382e825fcb6549cae4d7704ca5c15.tar.xz
drakx-40691a6bac8382e825fcb6549cae4d7704ca5c15.zip
moved probing code outside adsl_ask_info.
-rw-r--r--perl-install/network/adsl.pm11
1 files changed, 8 insertions, 3 deletions
diff --git a/perl-install/network/adsl.pm b/perl-install/network/adsl.pm
index cf5054a5e..893a9955b 100644
--- a/perl-install/network/adsl.pm
+++ b/perl-install/network/adsl.pm
@@ -69,21 +69,26 @@ If you don't know, choose 'use pppoe'"), $l) or return;
1;
}
-sub adsl_ask_info {
+sub adsl_probe_info {
my ($adsl, $netc, $_intf, $adsl_type) = @_;
my $pppoe_file = "$prefix/etc/ppp/pppoe.conf";
my $pptp_file = "$prefix/etc/sysconfig/network-scripts/net_cnx_up";
- my %pppoe_conf; %pppoe_conf = getVarsFromSh($pppoe_file) if $adsl_type =~ /pppoe/ && -f $pppoe_file;
+ my %pppoe_conf; %pppoe_conf = getVarsFromSh($pppoe_file) if (! defined $adsl_type || $adsl_type =~ /pppoe/) && -f $pppoe_file;
my $login = $pppoe_conf{USER};
foreach (qw(/etc/ppp/peers/adsl /etc/ppp/options /etc/ppp/options.adsl)) {
($login) = map { if_(/^user\s+\"([^\"]+)\"/, $1) } cat_("$prefix/$_") if !$login && -r "$prefix/$_";
}
- ($login) = map { if_(/\sname\s+([^ \n]+)/, $1) } cat_($pptp_file) if $adsl_type =~ /pptp/ && -r $pptp_file;
+ ($login) = map { if_(/\sname\s+([^ \n]+)/, $1) } cat_($pptp_file) if (! defined $adsl_type || $adsl_type =~ /pptp/) && -r $pptp_file;
my $passwd = passwd_by_login($login);
$pppoe_conf{DNS1} ||= '';
$pppoe_conf{DNS2} ||= '';
add2hash($netc, { dnsServer2 => $pppoe_conf{DNS1}, dnsServer3 => $pppoe_conf{DNS2}, DOMAINNAME2 => '' });
add2hash($adsl, { login => $login, passwd => $passwd, passwd2 => '' });
+}
+
+sub adsl_ask_info {
+ my ($adsl, $netc, $intf, $adsl_type) = @_;
+ adsl_probe_info($adsl, $netc, $intf, $adsl_type);
ask_info2($adsl, $netc);
}