From d7ab4699c74fabe8653afe6db174cfff0c33431e Mon Sep 17 00:00:00 2001 From: Francois Pons Date: Wed, 26 Feb 2003 13:03:17 +0000 Subject: try to get back DOMAINNAME if needed. --- perl-install/network/network.pm | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'perl-install') diff --git a/perl-install/network/network.pm b/perl-install/network/network.pm index 8ae8abb6a..1c303ab6b 100644 --- a/perl-install/network/network.pm +++ b/perl-install/network/network.pm @@ -82,18 +82,17 @@ sub down_it { sub write_conf { my ($file, $netc) = @_; - if ($netc->{HOSTNAME}) { - $netc->{HOSTNAME} =~ /\.(.+)$/; + if ($netc->{HOSTNAME} && $netc->{HOSTNAME} =~ /\.(.+)$/) { $netc->{DOMAINNAME} = $1; } - ($netc->{DOMAINNAME}) ||= 'localdomain'; + $netc->{DOMAINNAME} ||= 'localdomain'; add2hash($netc, { NETWORKING => "yes", FORWARD_IPV4 => "false", if_(!$netc->{DHCP}, HOSTNAME => "localhost.$netc->{DOMAINNAME}"), }); - setVarsInSh($file, $netc, if_(!$netc->{DHCP}, 'HOSTNAME'), qw(NETWORKING FORWARD_IPV4 GATEWAY GATEWAYDEV NISDOMAIN)); + setVarsInSh($file, $netc, if_(!$netc->{DHCP}, qw(HOSTNAME DOMAINNAME)), qw(NETWORKING FORWARD_IPV4 GATEWAY GATEWAYDEV NISDOMAIN)); } sub write_zeroconf { -- cgit v1.2.1