xref: /original-bsd/usr.sbin/amd/config/os-type (revision 753853ba)
1#!/bin/sh
2#
3# Copyright (c) 1989 Jan-Simon Pendry
4# Copyright (c) 1989 Imperial College of Science, Technology & Medicine
5# Copyright (c) 1989 The Regents of the University of California.
6# All rights reserved.
7#
8# This code is derived from software contributed to Berkeley by
9# Jan-Simon Pendry at Imperial College, London.
10#
11# %sccs.include.redist.sh%
12#
13#	@(#)os-type	5.5 (Berkeley) 02/09/92
14#
15# $Id: os-type,v 5.2.2.1 1992/02/09 15:11:23 jsp beta $
16#
17
18#
19# Take a pot-shot at your os type
20#
21echo "#	... No OS= option specified; dynamically determining OS type" >&2
22
23#
24# First try poking around in /etc/motd
25#
26
27case "`exec 2>/dev/null; head -2 /etc/motd`" in
28*"Sun UNIX 4.2 Release 3."*)	OS=sos3;;
29*"SunOS Release 4."*)		OS=sos4;;
30*"HP-UX on the HP"*)		OS=hpux;;
31*"Iris"*)			OS=irix;;
32*"Ultrix V2."*)			OS=u2_2;;
33*"Ultrix V3."*)			OS=u3_0;;
34*"Ultrix-32 V3."*)		OS=u3_0;;
35*"Ultrix Worksystem V2."*)	OS=u3_0;;
36*"ULTRIX V4.2"*)		OS=u4_2;;
37*"ULTRIX V4."*)			OS=u4_0;;
38*"HLH OTS Version 1."*)		OS=hlh42;;
39*"RISC iX release 1."*)		OS=riscix;;
40*"FPX 4."*)			OS=fpx4;;
41*"HCX/UX"*)			OS=hcx;;
42*"4.4 BSD UNIX"*)		OS=bsd44;;
43*"4.3 BSD Reno UNIX"*)		OS=bsd44;;
44*"4.3 BSD UNIX"*)		if [ -f /etc/minidisk ]; then
45					OS=acis43
46				elif [ -f /sbin/nfsiod ]; then
47					OS=bsd44	# prototype
48				else
49					OS=xinu43
50				fi;;
51*"Alliant Concentrix"*)		OS=concentrix;;
52*"Umax 4.3"*)			OS=umax43;;
53*)
54#
55# Well, that didn't work so apply some heuristics
56# to the filesystem name space...
57#
58				echo "#	... inspecting File system ..." >&2
59				if [ -f /etc/comply ]; then
60					OS=utek
61				elif [ -f /usr/bin/cat ]; then
62					OS=sos4
63				elif [ -f /etc/nd ]; then
64					OS=sos3
65				elif [ -f /etc/elcsd ]; then
66					echo "#	... Ultrix - assuming U4.0 ..." >&2
67					OS=u4_0
68				elif [ -f /hp-ux ]; then
69					OS=hpux
70				elif [ -f /etc/ttylocal ]; then
71					OS=xinu43
72				elif [ -f /etc/minidisk ]; then
73					OS=acis43
74				elif [ -f /etc/toolboxdaemon ]; then
75					OS=aux
76				elif [ -f /sbin/nfsiod ]; then
77					OS=bsd44
78				elif [ -d /vrm ]; then
79					OS=aix2
80				elif [ -d /etc/aix ]; then
81					OS=aix3
82				elif [ -f /bin/pyr ] && /bin/pyr; then
83					OS=pyrOSx
84				elif [ -d /NextApps ]; then
85					OS=next
86				elif [ -f /usr/lib/libgl.a ]; then
87					OS=irix
88				elif [ -f /stellix ]; then
89					OS=stellix
90				else
91					case "`(sh ../config/arch)2>/dev/null`" in
92					ibm032)    OS=acis43;;
93					aviion)    OS=dgux;;
94					*)	   OS=unknown;;
95					esac
96				fi;;
97esac
98
99echo "#	... OS appears to be \"${OS}\"" >&2
100echo "${OS}"
101exit 0
102