summaryrefslogtreecommitdiffstats
path: root/perl-install/network/ethernet.pm
diff options
context:
space:
mode:
authordamien <damien@mandriva.com>2001-07-30 15:54:38 +0000
committerdamien <damien@mandriva.com>2001-07-30 15:54:38 +0000
commit6c8dd68e7062a96d88a59cc128ac01ec28490a97 (patch)
treed4c1185a4853d53381e83894cd8f3b673495bd58 /perl-install/network/ethernet.pm
parent7aab173af2151843199dc229641f643538c8c161 (diff)
downloaddrakx-backup-do-not-use-6c8dd68e7062a96d88a59cc128ac01ec28490a97.tar
drakx-backup-do-not-use-6c8dd68e7062a96d88a59cc128ac01ec28490a97.tar.gz
drakx-backup-do-not-use-6c8dd68e7062a96d88a59cc128ac01ec28490a97.tar.bz2
drakx-backup-do-not-use-6c8dd68e7062a96d88a59cc128ac01ec28490a97.tar.xz
drakx-backup-do-not-use-6c8dd68e7062a96d88a59cc128ac01ec28490a97.zip
added internet connection selection in case of multiple configurations
Diffstat (limited to 'perl-install/network/ethernet.pm')
-rw-r--r--perl-install/network/ethernet.pm29
1 files changed, 12 insertions, 17 deletions
diff --git a/perl-install/network/ethernet.pm b/perl-install/network/ethernet.pm
index e61cf907f..db7c6d376 100644
--- a/perl-install/network/ethernet.pm
+++ b/perl-install/network/ethernet.pm
@@ -6,8 +6,9 @@ use any;
use detect_devices;
use common;
use run_program;
+use network::tools;
use vars qw(@ISA @EXPORT);
-use MDK::Common::Globals "network", qw($in $prefix $install $connect_file $disconnect_file);
+use MDK::Common::Globals "network", qw($in $prefix $install);
@ISA = qw(Exporter);
@EXPORT = qw(configureNetwork conf_network_card conf_network_card_backend go_ethernet);
@@ -66,19 +67,16 @@ sub configure_lan {
$netcnx->{NET_DEVICE} = $netc->{NET_DEVICE} = '';
$netcnx->{NET_INTERFACE} = 'lan'; #$netc->{NET_INTERFACE};
}
- output "$prefix$connect_file",
- qq(
+ write_cnx_script($netc, "local network",
+qq(
#!/bin/bash
/etc/rc.d/init.d/network restart
-);
- output "$prefix$disconnect_file",
- qq(
+),
+qq(
#!/bin/bash
/etc/rc.d/init.d/network stop
/sbin/ifup lo
-);
- chmod 0755, "$prefix$disconnect_file";
- chmod 0755, "$prefix$connect_file";
+));
$::isStandalone and modules::write_conf($prefix);
1;
}
@@ -168,18 +166,15 @@ sub go_ethernet {
conf_network_card($netc, $intf, $type, $ipadr, $netadr) or return;
$netc->{NET_INTERFACE}=$netc->{NET_DEVICE};
configureNetwork($netc, $intf, $first_time) or return;
- output "$prefix$connect_file",
- qq(
+ write_cnx_script($netc, "Local network",
+qq(
#!/bin/bash
ifup $netc->{NET_DEVICE}
-);
- output "$prefix$disconnect_file",
- qq(
+),
+qq(
#!/bin/bash
ifdown $netc->{NET_DEVICE}
-);
- chmod 0755, "$prefix$disconnect_file";
- chmod 0755, "$prefix$connect_file";
+));
if ( $::isStandalone and $netc->{NET_DEVICE}) {
$in->ask_yesorno(_("Network interface"),
_("I'm about to restart the network device $netc->{NET_DEVICE}. Do you agree?"), 1) and system("$prefix/sbin/ifdown $netc->{NET_DEVICE}; $prefix/sbin/ifup $netc->{NET_DEVICE}");