summaryrefslogtreecommitdiffstats
path: root/perl-install/network.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>1999-08-30 18:50:40 +0000
committerPascal Rigaux <pixel@mandriva.com>1999-08-30 18:50:40 +0000
commit1defcba73b989b6a28826c563417a7c0fc251052 (patch)
tree1d5bff21637dc8fb4f21fb9846ef6175c045d3f5 /perl-install/network.pm
parentfb80b8a8984779543f0f0c50d7f6dcb995e0ce96 (diff)
downloaddrakx-1defcba73b989b6a28826c563417a7c0fc251052.tar
drakx-1defcba73b989b6a28826c563417a7c0fc251052.tar.gz
drakx-1defcba73b989b6a28826c563417a7c0fc251052.tar.bz2
drakx-1defcba73b989b6a28826c563417a7c0fc251052.tar.xz
drakx-1defcba73b989b6a28826c563417a7c0fc251052.zip
no_comment
Diffstat (limited to 'perl-install/network.pm')
-rw-r--r--perl-install/network.pm9
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}$/;
+}