summaryrefslogtreecommitdiffstats
path: root/perl-install/network
diff options
context:
space:
mode:
authordamien <damien@mandriva.com>2002-01-04 18:48:11 +0000
committerdamien <damien@mandriva.com>2002-01-04 18:48:11 +0000
commit5a043df3d69677d02d4499b6ae6e40d798f2c9d3 (patch)
tree883cc9a9d131345dc03b0b54b4e8887265c9335f /perl-install/network
parentcc0025d4fb390ed4ce3c7c4a42fc77c353d6d53b (diff)
downloaddrakx-5a043df3d69677d02d4499b6ae6e40d798f2c9d3.tar
drakx-5a043df3d69677d02d4499b6ae6e40d798f2c9d3.tar.gz
drakx-5a043df3d69677d02d4499b6ae6e40d798f2c9d3.tar.bz2
drakx-5a043df3d69677d02d4499b6ae6e40d798f2c9d3.tar.xz
drakx-5a043df3d69677d02d4499b6ae6e40d798f2c9d3.zip
corrected minor bugs in network (among others bug "modifying read only values")
recode upNetwork and downNetwork (it might work, at least if you are lucky);
Diffstat (limited to 'perl-install/network')
-rw-r--r--perl-install/network/adsl.pm2
-rw-r--r--perl-install/network/netconnect.pm30
-rw-r--r--perl-install/network/tools.pm2
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);