diff options
Diffstat (limited to 'common')
-rw-r--r-- | common/scripts/IFCFG.pm | 12 |
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; } |