summaryrefslogtreecommitdiffstats
path: root/perl-install/network/tools.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install/network/tools.pm')
-rw-r--r--perl-install/network/tools.pm13
1 files changed, 11 insertions, 2 deletions
diff --git a/perl-install/network/tools.pm b/perl-install/network/tools.pm
index 6cf4f8f3a..851569e6d 100644
--- a/perl-install/network/tools.pm
+++ b/perl-install/network/tools.pm
@@ -3,12 +3,21 @@ package network::tools;
use common;
use run_program;
use vars qw(@ISA @EXPORT);
-use MDK::Common::Globals "network", qw($in $prefix $install $disconnect_file $connect_prog);
+use MDK::Common::Globals "network", qw($in $prefix $install $disconnect_file $connect_prog $connect_file $disconnect_file);
@ISA = qw(Exporter);
-@EXPORT = qw(write_secret_backend ask_connect_now connect_backend disconnect_backend read_providers_backend ask_info2 connected disconnected);
+@EXPORT = qw(write_cnx_script write_secret_backend ask_connect_now connect_backend disconnect_backend read_providers_backend ask_info2 connected disconnected);
@EXPORT_OK = qw($in);
+sub write_cnx_script {
+ my($netc, $type, $up, $down) = @_;
+ $type or output ("$prefix$_", $netc->{internet_cnx}{$netc->{internet_cnx_choice}}{$_}) foreach ($connect_file, $disconnect_file);
+ foreach ([$connect_file, $up], [$disconnect_file, $down]) {
+ $netc->{internet_cnx}{$type}{$_->[0]}=$_->[1];
+ chmod 0755, "$prefix" . $_->[0];
+ }
+}
+
sub write_secret_backend {
my ($a, $b) = @_;
foreach my $i ("pap-secrets", "chap-secrets") {