diff options
Diffstat (limited to 'perl-install/network')
-rw-r--r-- | perl-install/network/adsl.pm | 2 | ||||
-rw-r--r-- | perl-install/network/netconnect.pm | 30 | ||||
-rw-r--r-- | perl-install/network/tools.pm | 2 |
3 files changed, 26 insertions, 8 deletions
diff --git a/perl-install/network/adsl.pm b/perl-install/network/adsl.pm index 10bf80ec2..cb761dff4 100644 --- a/perl-install/network/adsl.pm +++ b/perl-install/network/adsl.pm @@ -7,7 +7,7 @@ use network::ethernet; use modules; use vars qw(@ISA @EXPORT); -use MDK::Common::Globals "network", qw($in $prefix $connect_file $disconnect_file); +use MDK::Common::Globals "network", qw($in $prefix); @ISA = qw(Exporter); @EXPORT = qw(adsl_ask_info adsl_detect adsl_conf adsl_conf_backend); diff --git a/perl-install/network/netconnect.pm b/perl-install/network/netconnect.pm index ea8c1574b..0c7d8fef8 100644 --- a/perl-install/network/netconnect.pm +++ b/perl-install/network/netconnect.pm @@ -17,6 +17,7 @@ use network; use network::tools; use MDK::Common::Globals "network", qw($in $prefix $connect_file $disconnect_file $connect_prog); +@EXPORT = qw(start_internet stop_internet); #- intro is called only in standalone. sub intro { @@ -107,14 +108,19 @@ sub pre_func { undef $::Wizard_no_previous; } +sub init_globals { + my ($in, $prefix) = @_; + MDK::Common::Globals::init( + in => $in, + prefix => $prefix, + connect_file => "/etc/sysconfig/network-scripts/net_cnx_up", + disconnect_file => "/etc/sysconfig/network-scripts/net_cnx_down", + connect_prog => "/etc/sysconfig/network-scripts/net_cnx_pg" ); +} + sub main { my ($prefix, $netcnx, $netc, $mouse, $in, $intf, $first_time, $direct_fr, $noauto) = @_; - MDK::Common::Globals::init( - in => $in, - prefix => $prefix, - connect_file => "/etc/sysconfig/network-scripts/net_cnx_up", - disconnect_file => "/etc/sysconfig/network-scripts/net_cnx_down", - connect_prog => "/etc/sysconfig/network-scripts/net_cnx_pg" ); + init_globals ($in, $prefix); $netc->{minus_one}=0; #When one configure an eth in dhcp without gateway $::isInstall and $in->set_help('configureNetwork'); $::isStandalone and read_net_conf($prefix, $netcnx, $netc); # REDONDANCE with intro. FIXME @@ -589,6 +595,18 @@ sub set_net_conf { setVarsInShMode("$prefix/etc/sysconfig/draknet.netc", 0600, $netc); #- doesn't work, don't know why } +sub start_internet { + my ($o) = @_; + init_globals ($o, $o->{prefix}); + run_program::rooted($prefix, $connect_file); +} + +sub stop_internet { + my ($o) = @_; + init_globals ($o, $o->{prefix}); + run_program::rooted($prefix, $disconnect_file); +} + #--------------------------------------------- # WONDERFULL pad #--------------------------------------------- diff --git a/perl-install/network/tools.pm b/perl-install/network/tools.pm index 0657e46be..e5ba822b7 100644 --- a/perl-install/network/tools.pm +++ b/perl-install/network/tools.pm @@ -4,7 +4,7 @@ use common; use run_program; use c; use vars qw(@ISA @EXPORT); -use MDK::Common::Globals "network", qw($in $prefix $disconnect_file $connect_prog $connect_file $disconnect_file); +use MDK::Common::Globals "network", qw($in $prefix $disconnect_file $connect_prog $connect_file); @ISA = qw(Exporter); @EXPORT = qw(write_cnx_script write_secret_backend write_initscript ask_connect_now connect_backend disconnect_backend read_providers_backend ask_info2 type2interface connected connected_bg connected2 disconnected); |