From 838b9f0b8668a4c81c39c9ea9f777952f1b46a0a Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Sun, 29 Dec 2002 11:50:19 +0000 Subject: - move any::pppConfig() to network::modem::ppp_configure() - move any::miscellaneousNetwork() to network::network::proxy_configure() (and uses the parameter instead of $::o->{miscellaneous}) - move network::network::miscellaneousNetwork() to network::network::miscellaneous_choose() (and do not export it) (and uses a parameter instead of $::o->{miscellaneous}) - move network::modem::pppConfig() to network::modem::ppp_choose() (and change parameter order, and drop unused parameter $intf) - do not export network::network::write_interface_conf() (since it is only used locally (?)) - cleanup network::network::write_interface_conf() (one still needs to pass $::o->{miscellaneous}{track_network_id} more cleanly, and use run_program::rooted when calling /sbin/ip) --- perl-install/any.pm | 170 ---------------------------------------------------- 1 file changed, 170 deletions(-) (limited to 'perl-install/any.pm') diff --git a/perl-install/any.pm b/perl-install/any.pm index 92bda10f8..578d7c465 100644 --- a/perl-install/any.pm +++ b/perl-install/any.pm @@ -426,176 +426,6 @@ sub inspect { $h; } -#-----modem conf -sub pppConfig { - my ($in, $modem, $prefix) = @_; - $modem or return; - - devfssymlinkf($modem, 'modem') if $modem->{device} ne "/dev/modem"; - $in->do_pkgs->install('ppp') if !$::testing; - - my %toreplace; - $toreplace{$_} = $modem->{$_} foreach qw(connection phone login passwd auth domain dns1 dns2); - $toreplace{kpppauth} = ${{ 'Script-based' => 0, 'PAP' => 1, 'Terminal-based' => 2, }}{$modem->{auth}}; - $toreplace{kpppauth} = ${{ 'Script-based' => 0, 'PAP' => 1, 'Terminal-based' => 2, 'CHAP' => 3 }}{$modem->{auth}}; - $toreplace{phone} =~ s/[a-zA-Z]//g; - $toreplace{dnsserver} = join ',', map { $modem->{$_} } "dns1", "dns2"; - $toreplace{dnsserver} .= $toreplace{dnsserver} && ','; - - #- using peerdns or dns1,dns2 avoid writing a /etc/resolv.conf file. - $toreplace{peerdns} = "yes"; - - $toreplace{connection} ||= 'DialupConnection'; - $toreplace{domain} ||= 'localdomain'; - $toreplace{intf} ||= 'ppp0'; - $toreplace{papname} = ($modem->{auth} eq 'PAP' || $modem->{auth} eq 'CHAP') && $toreplace{login}; - - #- build ifcfg-ppp0. - my $various = <{special_command}) { - push @chat, <{special_command}' -END - } - push @chat, <{auth} eq 'Terminal-based' || $modem->{auth} eq 'Script-based') { - push @chat, <{auth} eq 'PAP' || $modem->{auth} eq 'CHAP') { - #- need to create a secrets file for the connection. - my $secrets = "$prefix/etc/ppp/" . lc($modem->{auth}) . "-secrets"; - my @l = cat_($secrets); - my $replaced = 0; - do { $replaced ||= 1 - if s/^\s*"?$toreplace{login}"?\s+ppp0\s+(\S+)/"$toreplace{login}" ppp0 "$toreplace{passwd}"/ } foreach @l; - if ($replaced) { - output($secrets, @l); - } else { - append_to_file($secrets, "$toreplace{login} ppp0 \"$toreplace{passwd}\"\n"); - } - #- restore access right to secrets file, just in case. - chmod 0600, $secrets; - } - - #- install kppprc file according to used configuration. - mkdir_p("$prefix/usr/share/config"); - - output("$prefix/usr/share/config/kppprc", c::to_utf8(<{miscellaneous}, qw(http_proxy ftp_proxy)); - setExportedVarsInCsh("$::prefix/etc/profile.d/proxy.csh", $::o->{miscellaneous}, qw(http_proxy ftp_proxy)); -} - sub load_category { my ($in, $category, $auto, $at_least_one) = @_; -- cgit v1.2.1