chiark / gitweb /
Bomb if platform not recognised. Do not test $! after pclose. SunOS platform.
[ian-dotfiles.git] / config
1 @@-
2 chomp($hostname= `uname -n`); $? and die 'uname $?';
3 ($hostname)=(gethostbyname $hostname) or die "hostname $hostname ?";
4
5 chomp($s= `uname`); $? and die "platform $?";
6 if ($s =~ m/^Linux$/) {
7     chomp($_= `uname -m`); $? and die "platform $?";
8     if (m/^i\d86/) {
9         $platform= 'linux-i386';
10     } else {
11         die "$_ ?";
12     }
13 } elsif ($s =~ m/^SunOS$/) {
14     chomp($_= `uname -r`); $? and die "platform $?";
15     m/^\d+\.\d+/ or die "$_ ?";
16     $platform= "SunOS$&";
17 } else {
18     die "$s ?";
19 }
20
21 $ncipher= $hostname =~ m/\.ncipher\.com$/ ? 'cam' :
22           $hostname =~ m/\.ncipherusa\.com$/ ? 'bos' :
23           0;