summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2003-01-08 13:53:35 +0000
committerPascal Rigaux <pixel@mandriva.com>2003-01-08 13:53:35 +0000
commit4e0ddfe3dc1d7b8820d782a1bb2c7c74cf80b42d (patch)
tree941448e7fcb9b6f4a782e55a77dbbc94808bee66
parent93489676e60aba84b02a21751d8042d7ac607ec1 (diff)
downloaddrakx-backup-do-not-use-4e0ddfe3dc1d7b8820d782a1bb2c7c74cf80b42d.tar
drakx-backup-do-not-use-4e0ddfe3dc1d7b8820d782a1bb2c7c74cf80b42d.tar.gz
drakx-backup-do-not-use-4e0ddfe3dc1d7b8820d782a1bb2c7c74cf80b42d.tar.bz2
drakx-backup-do-not-use-4e0ddfe3dc1d7b8820d782a1bb2c7c74cf80b42d.tar.xz
drakx-backup-do-not-use-4e0ddfe3dc1d7b8820d782a1bb2c7c74cf80b42d.zip
(easy_dhcp): cleanup
-rw-r--r--perl-install/network/network.pm38
1 files changed, 19 insertions, 19 deletions
diff --git a/perl-install/network/network.pm b/perl-install/network/network.pm
index 92c11c2b8..2339c270f 100644
--- a/perl-install/network/network.pm
+++ b/perl-install/network/network.pm
@@ -13,7 +13,7 @@ use log;
use vars qw(@ISA @EXPORT);
@ISA = qw(Exporter);
-@EXPORT = qw(resolv configureNetworkIntf netmask dns is_ip masked_ip findIntf addDefaultRoute read_all_conf dnsServers guessHostname configureNetworkNet read_resolv_conf read_interface_conf add2hosts gateway configureNetwork2 write_conf sethostname down_it read_conf write_resolv_conf up_it, easy_dhcp);
+@EXPORT = qw(resolv configureNetworkIntf netmask dns is_ip masked_ip findIntf addDefaultRoute read_all_conf dnsServers guessHostname configureNetworkNet read_resolv_conf read_interface_conf add2hosts gateway configureNetwork2 write_conf sethostname down_it read_conf write_resolv_conf up_it);
#-######################################################################################
#- Functions
@@ -416,28 +416,28 @@ sub read_all_conf {
}
sub easy_dhcp {
- my ($in) = @_;
- my ($netc, $intf);
- $netc->{autodetect} = {};
+ my ($in, $netc, $intf) = @_;
- require network::netconnect;
- network::netconnect::detect($netc->{autodetect});
+ return if text2bool($netc->{NETWORKING});
+
+ require modules;
+ require network::ethernet;
+ modules::load_category('network/main|usb');
+ my @all_cards = network::ethernet::conf_network_card_backend();
#- only for a single network card
- if ($netc->{autodetect}{lan}{eth0} && !$netc->{autodetect}{lan}{eth1}) {
- $netc->{NETWORKING} = "yes";
- $netc->{FORWARD_IPV4} = "false";
- $netc->{HOSTNAME} = "localhost.localdomain";
- $netc->{DOMAINNAME} = "localdomain";
- $intf->{eth0}{DEVICE} = "eth0";
- $intf->{eth0}{BOOTPROTO} = "dhcp";
- $intf->{eth0}{ONBOOT} = "yes";
- $intf->{eth0}{NETMASK} = "255.255.255.0";
-
- configureNetwork2($in, '', $netc, $intf);
+ any { $_ eq 'eth0' } @all_cards && every { $_ ne 'eth1' } @all_cards or return;
+
+ network::ethernet::conf_network_card_backend($netc, $intf, 'dhcp', 'eth0');
+
+ put_in_hash($netc, {
+ NETWORKING => "yes",
+ FORWARD_IPV4 => "false",
+ HOSTNAME => "localhost.localdomain",
+ DOMAINNAME => "localdomain",
+ });
- run_program::rooted('', "/etc/rc.d/init.d/network restart") or return;
- } else { return 0 }
+ configureNetwork2($in, '', $netc, $intf);
1;
}