summaryrefslogtreecommitdiffstats
path: root/perl-install/standalone
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install/standalone')
-rwxr-xr-xperl-install/standalone/drakgw23
1 files changed, 11 insertions, 12 deletions
diff --git a/perl-install/standalone/drakgw b/perl-install/standalone/drakgw
index bba1b909b..d0e9611c9 100755
--- a/perl-install/standalone/drakgw
+++ b/perl-install/standalone/drakgw
@@ -1,9 +1,10 @@
#!/usr/bin/perl
#
-# Guillaume Cottenceau (gc@mandrakesoft.com)
+# author Guillaume Cottenceau (gc@mandrakesoft.com)
+# modified by Florin Grad (florin@mandrakesoft.com)
#
-# Copyright 2000-2002 MandrakeSoft
+# Copyright 2000-2003 MandrakeSoft
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2, as
@@ -240,8 +241,9 @@ I am about to setup your Local Area Network with that adapter.", $format->($devi
}
log::explanations("Choosing network device: $device");
-my $lan_address = $conf->{NETWORK} ||= "192.168.1.0";
-my $server_ip = $conf->{IPADDR} ||= "192.168.1.1";
+my $server_ip = network::network::read_dhcpd_conf()->{option_routers}[0] ||= "192.168.1.1";
+ $server_ip =~ m/(.*)\.(.*)/;
+my $lan_address = $1 ? "$1.0" : "192.168.1.0";
my $nameserver_ip = network::network::read_dhcpd_conf()->{domain_name_servers}[0] ||= "192.168.1.1";
my $netmask = network::network::read_dhcpd_conf()->{subnet_mask}[0] ||= "255.255.255.0";
my $start_range = network::network::read_dhcpd_conf()->{dynamic_bootp}[0] ||= "16";
@@ -250,11 +252,6 @@ my $default_lease = network::network::read_dhcpd_conf()->{max_lease_time}[0] ||=
my $max_lease = network::network::read_dhcpd_conf()->{default_lease_time}[0] ||= "43200";
my $internal_domain_name = network::network::read_dhcpd_conf()->{domain_name}[0] ||= network::network::read_resolv_conf_raw()->{nameserver}[0] ||= "homeland.net";
-#use Data::Dumper;
-#print Dumper(network::network::read_resolv_conf_raw()->{nameserver})."\n";
-#print network::network::read_resolv_conf_raw()->{nameserver}[0]."\n";
-#print Dumper(network::network::read_dhcpd_conf())."\n";
-
my $reconf_dhcp_server_intf = 1;
if (grep(/$device/, @configured_devices)) {
@@ -262,6 +259,7 @@ if (grep(/$device/, @configured_devices)) {
my $auto = N("Yes");
my $dhcp_details = N("Yes");
my $conf = network::read_interface_conf("/etc/sysconfig/network-scripts/ifcfg-$device");
+
$in->ask_from(N("Network interface already configured"),
N("Warning, the network adapter (%s) is already configured.
@@ -280,9 +278,10 @@ Driver: %s", $device, $conf->{NETWORK}, $conf->{IPADDR}, $conf->{BOOTPROTO}, $al
if ($auto ne N("Yes")) {
$reconf_dhcp_server_intf = 0;
- $server_ip = $conf->{IPADDR};
- $nameserver_ip = network::network::read_dhcpd_conf()->{domain_name_servers}[0] ||= $conf->{IPADDR};
- $lan_address = $conf->{NETWORK};
+ $server_ip = network::network::read_dhcpd_conf()->{option_routers}[0] ||= $conf->{IPADDR} ||= "192.168.1.1";
+ $nameserver_ip = network::network::read_dhcpd_conf()->{domain_name_servers}[0] ||= $conf->{IPADDR} ||= "192.168.1.1";
+ $server_ip =~ m/(.*)\.(.*)/;
+ $lan_address = $1 ? "$1.0" : $conf->{NETWORK};
$in->ask_from('',
N("I can keep your current configuration and assume you already set up a DHCP server; in that case please verify I correctly read the Network that you use for your local network; I will not reconfigure it and I will not touch your DHCP server configuration.