summaryrefslogtreecommitdiffstats
path: root/perl-install/network/netconnect.pm
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/netconnect.pm
parentcc0025d4fb390ed4ce3c7c4a42fc77c353d6d53b (diff)
downloaddrakx-backup-do-not-use-5a043df3d69677d02d4499b6ae6e40d798f2c9d3.tar
drakx-backup-do-not-use-5a043df3d69677d02d4499b6ae6e40d798f2c9d3.tar.gz
drakx-backup-do-not-use-5a043df3d69677d02d4499b6ae6e40d798f2c9d3.tar.bz2
drakx-backup-do-not-use-5a043df3d69677d02d4499b6ae6e40d798f2c9d3.tar.xz
drakx-backup-do-not-use-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/netconnect.pm')
-rw-r--r--perl-install/network/netconnect.pm30
1 files changed, 24 insertions, 6 deletions
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
#---------------------------------------------