summaryrefslogtreecommitdiffstats
path: root/perl-install/network/modem.pm
diff options
context:
space:
mode:
authorArnaud Desmons <adesmons@mandriva.com>2002-12-04 15:46:13 +0000
committerArnaud Desmons <adesmons@mandriva.com>2002-12-04 15:46:13 +0000
commit478a36482072904543037d2dd3afe7b70071accc (patch)
tree27c1b53a271056b8f0ac40b480e7344a8e96d997 /perl-install/network/modem.pm
parent9dc9f6ccbf673822ad658e2f434aa149e332a377 (diff)
downloaddrakx-478a36482072904543037d2dd3afe7b70071accc.tar
drakx-478a36482072904543037d2dd3afe7b70071accc.tar.gz
drakx-478a36482072904543037d2dd3afe7b70071accc.tar.bz2
drakx-478a36482072904543037d2dd3afe7b70071accc.tar.xz
drakx-478a36482072904543037d2dd3afe7b70071accc.zip
More data are now fetched from system instead of drakconnect conf file
Diffstat (limited to 'perl-install/network/modem.pm')
-rw-r--r--perl-install/network/modem.pm31
1 files changed, 26 insertions, 5 deletions
diff --git a/perl-install/network/modem.pm b/perl-install/network/modem.pm
index c8a9e4722..b466fabca 100644
--- a/perl-install/network/modem.pm
+++ b/perl-install/network/modem.pm
@@ -16,11 +16,27 @@ use Data::Dumper;
sub configure {
my ($netcnx, $mouse, $netc, $intf) = @_;
$netcnx->{type} = 'modem';
+ my $modem = $netcnx->{$netcnx->{type}};
# $netcnx->{$netcnx->{type}} = {};
-# $netcnx->{modem}{device} = $netc->{autodetect}{modem};
+ $modem->{device} = $netc->{autodetect}{modem};
# modem_step_1:
- $netcnx->{$netcnx->{type}}{login} = ($netcnx->{$netcnx->{type}}{auth} eq 'PAP' || $netcnx->{$netcnx->{type}}{auth} eq 'CHAP') && $intf->{ppp0}{PAPNAME};
- pppConfig($netcnx->{$netcnx->{type}}, $mouse, $netc, $intf) or return;
+# $modem->{login} = ($modem->{auth} eq 'PAP' ||$modem->{auth} eq 'CHAP') && $intf->{ppp0}{PAPNAME};
+# $netcnx->{$netcnx->{type}}->{connection} = ($netcnx->{$netcnx->{type}}->{auth} eq 'PAP' || $netcnx->{$netcnx->{type}}->{auth} eq 'CHAP') && $intf->{ppp0}{PAPNAME};
+# $modem->{device} = readlink "$prefix/dev/modem";
+ foreach (cat_("/usr/share/config/kppprc")) {
+ /^DNS=(.*)$/ and ($modem->{dns1}, $modem->{dns2}) = split (',', $1);
+ }
+ my $secret = network::tools::read_secret_backend();
+ foreach (@$secret) {
+ $modem->{passwd} = $_->{passwd} if ($_->{login} eq $modem->{login});
+ }
+ foreach (cat_("/etc/sysconfig/network-scripts/chat-ppp0")) {
+ if (/.*ATDT(\d*).*/) {
+ $modem->{phone} = $1;
+ last;
+ }
+ }
+ pppConfig($modem, $mouse, $netc, $intf) or return;
write_cnx_script($netc, "modem",
q(
/sbin/route del default
@@ -34,17 +50,22 @@ killall pppd
sub pppConfig {
my ($modem, $mouse, $netc, $intf) = @_;
-
$mouse ||= {};
+
$mouse->{device} ||= readlink "$prefix/dev/mouse";
$::isInstall and $in->set_help('selectSerialPort');
$modem->{device} ||= $in->ask_from_listf('', N("Please choose which serial port your modem is connected to."),
\&mouse::serial_port2text,
[ grep { $_ ne $mouse->{device} } (mouse::serial_ports(), if_(-e '/dev/modem', '/dev/modem')) ]) || return;
+ my @cnx_list;
+ my $secret = network::tools::read_secret_backend();
+ foreach (@$secret) {
+ push @cnx_list, $_->{server};
+ }
$::isStandalone || $in->set_help('configureNetworkISP');
$in->ask_from('', N("Dialup options"), [
-{ label => N("Connection name"), val => \$modem->{connection} },
+{ label => N("Connection name"), val => \$modem->{connection}},
{ label => N("Phone number"), val => \$modem->{phone} },
{ label => N("Login ID"), val => \$modem->{login} },
{ label => N("Password"), val => \$modem->{passwd}, hidden => 1 },