X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?p=ian-dotfiles.git;a=blobdiff_plain;f=config;h=d618ababab8e3ac8cbfd99c17e6bef28217abe82;hp=9014c2a694a1afd423d4647db8bd8d00b2723675;hb=637096da9d5b229831b2bf3c774f78a477062464;hpb=4fd494a89f036948677ae8ed3b4ea9ad1f1ad90f diff --git a/config b/config index 9014c2a..d618aba 100644 --- a/config +++ b/config @@ -1,2 +1,49 @@ @@- -chomp($hostname= `uname -n`); $? and die; +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($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 ($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"; + $xbindir= '/usr/X11R6/bin'; +} 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 "$uname ?"; +} + +$ncipher= $hostname =~ m/\.(ncipher\.com$)/ ? 'cam' : + $hostname =~ m/\.(ncipherusa\.com$)/ ? 'bos' : + 0; + +$chiark= $hostname =~ m/chiark/; + +%ncipherdom= ('cam' => 'ncipher.com', + 'bos' => 'ncipherusa.com');