chiark / gitweb /
AIX; nCipher keys; greenock
[ian-dotfiles.git] / config
diff --git a/config b/config
index c1e03623408ad0d451aa72981b98c8b46413165f..16e37cc27a06d339622dc74e5b2ca45abd9539f8 100644 (file)
--- a/config
+++ b/config
@@ -1,25 +1,41 @@
 @@-
-chomp($nodename= `uname -n`); $? and die 'uname $?';
-($hostname)=(gethostbyname $nodename) or die "hostname $nodename ?";
-$nodename =~ s/\..*//;
+chomp($nodename= `uname -n`); $? and die "uname $?";
+chomp($username= `whoami`); $? and die "whoami $?";
+
+@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($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 "$_ ?";
     }
-} 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';
+} elsif ($uname =~ m/^FreeBSD/) {
+    chomp($_= `uname -r`); $? and die "platform $?";
+    m/^(\d+\.\d+)\-/ or die "$_ ?";
+    $platform= "FreeBSD-$1";
+} elsif ($uname =~ m/^HP\-UX/) {
+    chomp($_= `uname -r`); $? and die "platform $?";
+    m/^B\.(\d+\.\d+)$/ or die "$_ ?";
+    $platform= "HP-UX$1";
+} elsif ($uname =~ m/^AIX/) {
+    chomp($_= `uname -rv`); $? and die "platform $?";
+    m/^\d+ (\d+)$/ or die "$_ ?";
+    $platform= "AIX$1";
 } else {
-    die "$s ?";
+    die "$uname ?";
 }
 
 $ncipher= $hostname =~ m/\.(ncipher\.com$)/    ? 'cam' :