summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorent Villard <warly@mandriva.com>2003-02-28 18:48:08 +0000
committerFlorent Villard <warly@mandriva.com>2003-02-28 18:48:08 +0000
commit95147b49a34217f6bfd43661e09f10a26cae8802 (patch)
tree86a8e72f147e6c2538eef04e839324bafa345b13
parentb2c33ddc8e1674ea9c58c11827b997e4b9816ddc (diff)
downloaddrakwizard-95147b49a34217f6bfd43661e09f10a26cae8802.tar
drakwizard-95147b49a34217f6bfd43661e09f10a26cae8802.tar.gz
drakwizard-95147b49a34217f6bfd43661e09f10a26cae8802.tar.bz2
drakwizard-95147b49a34217f6bfd43661e09f10a26cae8802.tar.xz
drakwizard-95147b49a34217f6bfd43661e09f10a26cae8802.zip
remove unknow fields from dhcpd.conf and add ip of the gateway and dnsserver
-rw-r--r--common/scripts/IFCFG.pm12
-rw-r--r--dhcp_wizard/scripts/Dhcpconf.pm8
-rw-r--r--dhcp_wizard/scripts/dhcpd.conf.default8
-rw-r--r--ftp_wizard/ftp.wiz5
-rw-r--r--ftp_wizard/scripts/ProFtpconf.pm3
-rw-r--r--po/drakwizard.pot2
6 files changed, 24 insertions, 14 deletions
diff --git a/common/scripts/IFCFG.pm b/common/scripts/IFCFG.pm
index 669525f7..ea8d6891 100644
--- a/common/scripts/IFCFG.pm
+++ b/common/scripts/IFCFG.pm
@@ -20,8 +20,10 @@
package IFCFG;
use strict;
+use lib qw(/usr/lib/libDrakX);
use Data::Dumper;
use MDK::Common;
+use network::network;
#my $file = "/etc/sysconfig/network-scripts/drakconnect_conf";
#!-f $file and die "no such $file";
@@ -43,8 +45,14 @@ sub new {
}
}
%{$self->{network}} = getVarsFromSh("/etc/sysconfig/network");
- $self->{network}{HOSTNAME} ||= `hostname` and chomp $self->{network}{HOSTNAME};
- ($self->{network}{DOMAINNAME}) = $self->{network}{HOSTNAME} =~ /\.(.*)/ || (`dnsdomainname`) and chomp $self->{network}{DOMAINNAME};
+ my $r = read_resolv_conf();
+ foreach my $k (keys %$r) {
+ print "RESOLV $k => $r->{$k}\n";
+ $self->{network}{$k} ||= $r->{$k}
+ }
+ $self->{network}{HOSTNAME} ||= `/bin/hostname` and chomp $self->{network}{HOSTNAME};
+ ($self->{network}{DOMAINNAME}) = $self->{network}{HOSTNAME} =~ /\.(.*)/;
+ $self->{network}{DOMAINNAME} ||= `/bin/dnsdomainname` and chomp $self->{network}{DOMAINNAME};
bless $self;
}
diff --git a/dhcp_wizard/scripts/Dhcpconf.pm b/dhcp_wizard/scripts/Dhcpconf.pm
index d94db67d..881ef56f 100644
--- a/dhcp_wizard/scripts/Dhcpconf.pm
+++ b/dhcp_wizard/scripts/Dhcpconf.pm
@@ -73,6 +73,12 @@ sub check_dhcp {
sub do_it {
my $wiz_domain_name = $o->network_get("DOMAINNAME");
my $wiz_host_name = $o->network_get("HOSTNAME");
+ my $wiz_gateway = $o->network_get("GATEWAY");
+ my $wiz_dns = $o->network_get("dnsServer");
+ if (!$wiz_gateway) {
+ my $t = `LC_ALL=C /sbin/ip route list scope global`;
+ ($wiz_gateway) = $t =~ /default via (\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}) dev/;
+ }
my $wiz_ip_net = "$1.$2.$3.0" if $wiz_ip_server =~ /(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})/;
my $err = check();
return $err if $err != 10;
@@ -115,12 +121,14 @@ sub do_it {
-f $file and MDK::Common::cp_af($file, $file.".orig");
output($file, map {
s|__hname__|$wiz_host_name|g;
+ s|__dns__|$wiz_dns|g;
s|__net__|$wiz_ip_net|g;
s|__ip__|$wiz_ip_server|g;
s|__mask__|$wiz_ip_netmask|g;
s|__rng1__|$wiz_ip_range1|g;
s|__rng2__|$wiz_ip_range2|g;
s|__dname__|$wiz_domain_name|g;
+ s|__gateway__|$wiz_gateway|g;
$_;
} cat_ ("__WIZ_HOME__/dhcp_wizard/scripts/dhcpd.conf.default"));
standalone::explanations("$file: hname = $wiz_host_name, net = $wiz_ip_net, ip = $wiz_ip_server,
diff --git a/dhcp_wizard/scripts/dhcpd.conf.default b/dhcp_wizard/scripts/dhcpd.conf.default
index 58e5ab35..ec2e20c2 100644
--- a/dhcp_wizard/scripts/dhcpd.conf.default
+++ b/dhcp_wizard/scripts/dhcpd.conf.default
@@ -11,13 +11,9 @@ not authoritative;
subnet __net__ netmask __mask__{
range __rng1__ __rng2__;
option domain-name "__dname__";
- option domain-name-servers __ip__;
- option nis-servers __ip__;
- option lpr-servers __ip__;
- option netbios-name-servers __ip__;
- option routers __ip__;
+ option domain-name-servers __dns__;
+ option routers __gateway__;
option subnet-mask __mask__;
- option time-servers __ip__;
ddns-updates on;
ddns-domainname "__dname__";
ddns-rev-domainname "in-addr.arpa";
diff --git a/ftp_wizard/ftp.wiz b/ftp_wizard/ftp.wiz
index e34ad798..fb145044 100644
--- a/ftp_wizard/ftp.wiz
+++ b/ftp_wizard/ftp.wiz
@@ -199,11 +199,12 @@
<Freetext
name="freetext_dir"
variableName="wiz_dir"
- helpText="Shared directory:"
- editable="true"
fillfunc="get_dir"
+ helpText="Shared directory:"
+ editable="true"
>
</Freetext>
+
</Page>
diff --git a/ftp_wizard/scripts/ProFtpconf.pm b/ftp_wizard/scripts/ProFtpconf.pm
index 711ecc3c..fece3460 100644
--- a/ftp_wizard/scripts/ProFtpconf.pm
+++ b/ftp_wizard/scripts/ProFtpconf.pm
@@ -34,9 +34,6 @@ sub true {
}
sub check_dir {
- foreach (keys %ENV) {
- print "$_ $ENV{$_}\n";
- }
-d ($ENV{wiz_dir}) and return 10;
1;
}
diff --git a/po/drakwizard.pot b/po/drakwizard.pot
index b47ec9f6..ee1040cf 100644
--- a/po/drakwizard.pot
+++ b/po/drakwizard.pot
@@ -7,7 +7,7 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
-"POT-Creation-Date: 2003-03-01 13:06+0100\n"
+"POT-Creation-Date: 2003-03-01 14:12+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"