1 | #!/bin/bash |
---|
2 | # $Id$ |
---|
3 | #-----------------------------------------------# |
---|
4 | #--- What is host ? - w_i_h - 21/07/2009 ---# |
---|
5 | #-----------------------------------------------# |
---|
6 | w_z=$(uname -s -n -r -m 2>/dev/null); |
---|
7 | [[ ${?} != 0 ]] && { exit 1; } |
---|
8 | read u_s u_n u_r u_m <<< ${w_z} |
---|
9 | unset w_z; |
---|
10 | #- |
---|
11 | d_n=$(dirname ${0}); |
---|
12 | #- |
---|
13 | case ${u_s} in |
---|
14 | ( AIX ) \ |
---|
15 | { case ${u_n} in |
---|
16 | ( zahir* ) DSYS="aix";; |
---|
17 | ( vargas* ) DSYS="aix6";; |
---|
18 | ( * ) DSYS="ax_mono"; |
---|
19 | esac |
---|
20 | };; |
---|
21 | ( AIXESA ) DSYS="aixesa";; |
---|
22 | ( ConvexOS ) DSYS="convex";; |
---|
23 | ( CP486 | dev ) DSYS="sco";; |
---|
24 | ( Darwin ) DSYS="Darwin";; |
---|
25 | ( HP-UX ) \ |
---|
26 | { case ${u_n} in |
---|
27 | ( moon ) DSYS="eshpux";; |
---|
28 | ( * ) DSYS="hpux";; |
---|
29 | esac |
---|
30 | };; |
---|
31 | ( IRIX ) \ |
---|
32 | { case ${u_r} in |
---|
33 | ( 4\.* ) DSYS="sgi4";; |
---|
34 | ( * ) DSYS="sgi5";; |
---|
35 | esac |
---|
36 | };; |
---|
37 | ( IRIX64 ) DSYS="sgi6";; |
---|
38 | ( Linux ) \ |
---|
39 | { case ${u_n} in |
---|
40 | ( asterix* | obelix* ) DSYS="lxiv8";; |
---|
41 | ( argent[0-9]* ) DSYS="argent";; |
---|
42 | ( cesium[0-9]* ) DSYS="cesium";; |
---|
43 | ( platine[0-9]* ) DSYS="platine";; |
---|
44 | ( titane[0-9]* ) DSYS="titane";; |
---|
45 | ( mercure* ) \ |
---|
46 | { DSYS="sx8mercure" |
---|
47 | u_l=$(/usr/bin/modulecmd bash list -t 2>&1) |
---|
48 | for h in ${u_l} |
---|
49 | do |
---|
50 | [[ ${h} = 'SX9' ]] && { DSYS="sx9mercure"; break; } |
---|
51 | done |
---|
52 | unset u_l h |
---|
53 | };; |
---|
54 | ( brodie ) DSYS="sx8brodie";; |
---|
55 | ( ulam ) DSYS="ulam";; |
---|
56 | ( ds[0-9]* ) DSYS="sxdkrz";; |
---|
57 | ( babel* ) DSYS="babel";; |
---|
58 | ( * ) DSYS="linux";; |
---|
59 | esac |
---|
60 | };; |
---|
61 | ( MIPS ) DSYS="mips";; |
---|
62 | ( OSF1 ) DSYS="osf1";; |
---|
63 | ( SunOS ) \ |
---|
64 | { case ${u_r} in |
---|
65 | ( 5\.* ) DSYS="solaris";; |
---|
66 | ( * ) DSYS="sun";; |
---|
67 | esac |
---|
68 | };; |
---|
69 | ( SUPER-UX ) DSYS="nec";; |
---|
70 | ( ULTRIX ) DSYS="ultrix";; |
---|
71 | ( UNICOS | sn4803 | sn4602 ) DSYS="cray";; |
---|
72 | ( UNIX_System_V ) DSYS="fjvpp";; |
---|
73 | (*) \ |
---|
74 | { case ${u_m} in |
---|
75 | ( "CRAY T3E" ) DSYS="t3e";; |
---|
76 | ( * ) DSYS="Unknown";; |
---|
77 | esac |
---|
78 | };; |
---|
79 | esac |
---|
80 | #- |
---|
81 | echo "$DSYS"; |
---|
82 | unset u_s u_n u_r u_m; |
---|
83 | #- |
---|
84 | exit 0; |
---|