From f756327e8545b80bf4a11c474531f66309cbf15a Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Thu, 8 Sep 2005 13:00:56 +0000 Subject: do not let modem settings be overriden by previous ppp0 settings --- perl-install/network/modem.pm | 61 ++++++++++++++++++------------------- perl-install/network/netconnect.pm | 2 +- perl-install/standalone/drakconnect | 2 +- 3 files changed, 31 insertions(+), 34 deletions(-) (limited to 'perl-install') diff --git a/perl-install/network/modem.pm b/perl-install/network/modem.pm index f04085e89..838224f85 100644 --- a/perl-install/network/modem.pm +++ b/perl-install/network/modem.pm @@ -53,7 +53,7 @@ sub ppp_read_conf() { #-----modem conf sub ppp_configure { - my ($in, $modem) = @_; + my ($net, $in, $modem) = @_; $in->do_pkgs->install('ppp') if !$::testing; $in->do_pkgs->install('kdenetwork-kppp') if !$::testing && $in->do_pkgs->is_installed('kdebase'); @@ -75,7 +75,6 @@ sub ppp_configure { $toreplace{connection} ||= 'DialupConnection'; $toreplace{domain} ||= 'localdomain'; - $toreplace{intf} ||= 'ppp0'; $toreplace{papname} = $toreplace{login} if member($modem->{Authentication}, 1, 3, 4); # handle static/dynamic settings: @@ -88,36 +87,34 @@ sub ppp_configure { $toreplace{METRIC} = defined($modem->{METRIC}) ? $modem->{METRIC} : network::tools::get_default_metric("modem"); - #- build ifcfg-ppp0. - my $various = <{auto_dns} ne N("Automatic"), map { qq(DNS$_=$toreplace{"dns$_"}\n) } grep { $toreplace{"dns$_"} } 1..2)); + $net->{ifcfg}{ppp0} = { + DEVICE => "ppp0", + ONBOOT => "no", + USERCTL => "no", + MODEMPORT => "/dev/modem", + LINESPEED => "115200", + PERSIST => "yes", + DEFABORT => "yes", + DEBUG => "yes", + INITSTRING => "ATZ", + DEFROUTE => "yes", + HARDFLOWCTL => "yes", + ESCAPECHARS => "no", + PPPOPTIONS => "", + PAPNAME => $toreplace{papname}, + REMIP => "", + NETMASK => "", + IPADDR => "", + MRU => "", + MTU => "", + DISCONNECTTIMEOUT => "5", + RETRYTIMEOUT => "60", + BOOTPROTO => "none", + PEERDNS => $toreplace{peerdns}, + METRIC => $toreplace{METRIC}, + if_($modem->{auto_dns} ne N("Automatic"), + map { qq(DNS$_=$toreplace{"dns$_"}\n) } grep { $toreplace{"dns$_"} } 1..2), + }; #- build chat-ppp0. my @chat = < sub { - network::modem::ppp_configure($in, $modem); + network::modem::ppp_configure($net, $in, $modem); $net->{net_interface} = 'ppp0'; "allow_user_ctl"; }, diff --git a/perl-install/standalone/drakconnect b/perl-install/standalone/drakconnect index 9f41d9751..bd04c475b 100755 --- a/perl-install/standalone/drakconnect +++ b/perl-install/standalone/drakconnect @@ -272,7 +272,7 @@ sub build_tree { elsif ($interface eq 'modem') { $intf->{pages} = { 'TCP/IP' => 1, 'Account' => 1, 'Modem' => 1, 'Options' => 1 }; put_in_hash($intf, network::modem::ppp_read_conf()); - $intf->{save} = sub { network::modem::ppp_configure($in, $intf) }; + $intf->{save} = sub { network::modem::ppp_configure($net, $in, $intf) }; } elsif ($interface eq 'isdn') { $intf->{pages} = { 'TCP/IP' => 1, 'Account' => 1, 'Modem' => 1, 'Options' => 1 }; -- cgit v1.2.1