chiark
/
gitweb
/
~ian
/
ian-dotfiles.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Understand if host canonical name has no dot.
[ian-dotfiles.git]
/
config
diff --git
a/config
b/config
index 4639ad581bff0ced860ec8a1b062a7bd1e77a2cf..34a0e56eadad4ff816b483e211b78fe084495049 100644
(file)
--- a/
config
+++ b/
config
@@
-1,27
+1,37
@@
@@-
chomp($nodename= `uname -n`); $? and die 'uname $?';
@@-
chomp($nodename= `uname -n`); $? and die 'uname $?';
-($hostname)=(gethostbyname $nodename) or die "hostname $nodename ?";
+@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';
$xbindir= '/usr/bin/X11';
-chomp($
s
= `uname`); $? and die "platform $?";
-if ($
s
=~ m/^Linux$/) {
+chomp($
uname
= `uname`); $? and die "platform $?";
+if ($
uname
=~ m/^Linux$/) {
chomp($_= `uname -m`); $? and die "platform $?";
if (m/^i\d86/) {
$platform= 'linux-i386';
} else {
die "$_ ?";
}
chomp($_= `uname -m`); $? and die "platform $?";
if (m/^i\d86/) {
$platform= 'linux-i386';
} else {
die "$_ ?";
}
-} elsif ($
s
=~ m/^SunOS$/) {
+} elsif ($
uname
=~ m/^SunOS$/) {
chomp($_= `uname -r`); $? and die "platform $?";
m/^\d+\.\d+/ or die "$_ ?";
$platform= "SunOS$&";
$xbindir= '/usr/openwin/bin';
chomp($_= `uname -r`); $? and die "platform $?";
m/^\d+\.\d+/ or die "$_ ?";
$platform= "SunOS$&";
$xbindir= '/usr/openwin/bin';
+} elsif ($uname =~ m/^HP\-UX/) {
+ chomp($_= `uname -r`); $? and die "platform $?";
+ m/^B\.(\d+\.\d+)$/ or die "$_ ?";
+ $platform= "HP-UX$1";
} else {
} else {
- die "$
s
?";
+ die "$
uname
?";
}
}
-$ncipher= $hostname =~ m/\.
ncipher\.com$/
? 'cam' :
- $hostname =~ m/\.
ncipherusa\.com$
/ ? 'bos' :
+$ncipher= $hostname =~ m/\.
(ncipher\.com$)/
? 'cam' :
+ $hostname =~ m/\.
(ncipherusa\.com$)
/ ? 'bos' :
0;
0;
+%ncipherdom= ('cam' => 'ncipher.com',
+ 'bos' => 'ncipherusa.com');