From: ian Date: Wed, 10 Jul 2002 10:38:31 +0000 (+0000) Subject: Understand if host canonical name has no dot. X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?a=commitdiff_plain;h=90ad27fcae64db4ee27040e9aaff91ffe56de537;p=ian-dotfiles.git Understand if host canonical name has no dot. --- diff --git a/config b/config index 83fa181..34a0e56 100644 --- a/config +++ b/config @@ -1,8 +1,11 @@ @@- chomp($nodename= `uname -n`); $? and die 'uname $?'; -($hostname)=(gethostbyname $nodename) or die "hostname $nodename ?"; -$nodename =~ s/\..*//; +@he= gethostbyname $nodename or die "gethostbyname $nodename ?"; +@hostnames= ($he[0], split /\s/, $he[1]); +($hostname)= grep /\./, @hostnames or die "no fqdn in @hostnames"; + +$nodename =~ s/\..*//; $xbindir= '/usr/bin/X11'; chomp($uname= `uname`); $? and die "platform $?";