summaryrefslogtreecommitdiffstats
path: root/common/scripts
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 /common/scripts
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
Diffstat (limited to 'common/scripts')
-rw-r--r--common/scripts/IFCFG.pm12
1 files changed, 10 insertions, 2 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;
}