From b53593dd74b1c255d6e3cba0eef5ade14b6d6c2b Mon Sep 17 00:00:00 2001 From: Florent Villard Date: Fri, 28 Feb 2003 15:26:37 +0000 Subject: fix dhcp wizard --- common/scripts/IFCFG.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'common') diff --git a/common/scripts/IFCFG.pm b/common/scripts/IFCFG.pm index 2d1171ba..669525f7 100644 --- a/common/scripts/IFCFG.pm +++ b/common/scripts/IFCFG.pm @@ -43,6 +43,8 @@ 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}; bless $self; } @@ -72,7 +74,7 @@ sub network_get { my $self = shift; my ($key) = @_; - exists $self->{network}->{$key} or die "no $key field in network hash"; + exists $self->{network}{$key} or die "no $key field in network hash"; $self->{network}{$key}; } -- cgit v1.2.1