-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathplatform
executable file
·103 lines (96 loc) · 2.33 KB
/
platform
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
:
#
# platx
# Attemps, in vain, to determine the platform -- great if we could get
# hardware and software (OS) base. First shot at this -- wanted to do this
# for a while, then re-stolen from Todd Merriman's "platform".
#
# *might* work on Xenix/386, CTIX, 386/ix, DG/UX, SunOS, DYNIX, eta10's,
# ibm risc boxes, pyramids, decstations, etc. Uses the arch, file, and
# uname commands to try to figure things out. Vaxen and such will
# definitely not work.
#
if test -s "/bin/arch" ; then
# this gives strange results on some machines...
# /bin/arch -k
/bin/arch
exit 0
fi
if test -s "/bin/uname" ; then
type=`uname -m`
# Convergent S640
if test "$type" = "miti2" ; then
echo "CTIX"; exit 0
fi
# Sequent Interactive 386/ix and DYNIX
if test "$type" = "i386" ; then
if test "`uname -v`" = "DYNIX" ; then
echo "DYNIX"
exit 0
else
echo "386_ix"
exit 0
fi
fi
# SGI stuff:
if test "$type" = "IP4" -o "$type" = "IP12" ; then
echo "SGI_IRIX"; exit 0;
fi
# DG/UX 88000
if test "$type" = "AViiON" ; then
echo "DG_UX"; exit 0;
fi
# IBM's RISC/AIX
if test "$type" = "AIX" ; then
echo "aix"; exit 0;
fi
# SCO Xenix
if test "$type" = "3" ; then
echo "Xenix_386"; exit 0;
fi
# else { print "$type???\n"; exit 0;}
fi
# locations of "file" executable?
dirs="/bin /usr/bin"
typical_executable="/bin/ls"
for dir in $dirs ; do
if test -r "$dir/file" ; then
output=`$dir/file $typical_executable`
type=`echo $output | awk '{print $2}'`
if test "$type" = "mipsel" ; then
echo "DECstation"; exit 0
fi
if test "$type" = "90x" ; then
echo "dec"; exit 0
fi
if test "$type" = "SYMMETRY" ; then
echo "Sequent_Symmetry" ; exit 0
fi
fi
done
# also stolen from the net...
#
# rt_bsd: 4.3 BSD on RT
# aix_22: AIX 2.* on RT
# aix_11: AIX 1.1 or AIX 1.2 on PS/2
# aix_31: AIX 3.1 on RISC 6000
if test -f "/unix" ; then
if test -d "/vrm" ; then
# echo "aix_22"
echo "aix"
exit 1;
else
if test -d "/etc/security" ; then
# echo "aix_31" ; exit 1;
echo "aix" ; exit 1;
else
# echo "aix_11" ; exit 1;
echo "aix" ; exit 1;
fi
fi
fi
# apollo stuff; thanks to the apollo mailing list!
if test -d /sys/node_data ; then
echo "apollo" ; exit 1
fi
exit 1;