diff options
Diffstat (limited to 'perl-install/network.pm')
-rw-r--r-- | perl-install/network.pm | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/perl-install/network.pm b/perl-install/network.pm index f37012892..15a4cbb02 100644 --- a/perl-install/network.pm +++ b/perl-install/network.pm @@ -36,8 +36,8 @@ sub write_conf { NETWORKING => "yes", FORWARD_IPV4 => "false", HOSTNAME => "localhost.localdomain", - DOMAINNAME => "localdomain", }); + add2hash($netc, { DOMAINNAME => $netc->{HOSTNAME} =~ /\.(.*)/ }); setVarsInSh($file, $netc, qw(NETWORKING FORWARD_IPV4 HOSTNAME DOMAINNAME GATEWAY GATEWAYDEV)); } @@ -109,12 +109,11 @@ sub guessHostname { write_resolv_conf("$prefix/etc/resolv.conf", $netc); -# winStatus(40, 3, _("Hostname"), _("Determining host name and domain...")); my $name = gethostbyaddr(Socket::inet_aton($intf->{IPADDR}), AF_INET) or log::l("reverse name lookup failed"), return 0; log::l("reverse name lookup worked"); - add2hash($netc, { HOSTNAME => $name, DOMAINNAME => $name =~ /\.(.*)/ }); + add2hash($netc, { HOSTNAME => $name }); 1; } @@ -144,3 +143,7 @@ sub findIntf { push @$intf, $l = { DEVICE => $device } unless $l; $l; } + +sub is_ip { + $_[0] =~ /^(\d{1,3}\.){3}\d{1,3}$/; +} |