xref: /original-bsd/usr.sbin/amd/config/os-type (revision c3e32dec)
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, 1993
6#	The Regents of the University of California.  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	8.1 (Berkeley) 06/06/93
14#
15# $Id: os-type,v 5.2.2.2 1992/05/31 16:45:46 jsp Exp $
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*"Ultrix V2."*)			OS=u2_2;;
32*"Ultrix V3."*)			OS=u3_0;;
33*"Ultrix-32 V3."*)		OS=u3_0;;
34*"Ultrix Worksystem V2."*)	OS=u3_0;;
35*"ULTRIX V4.2"*)		OS=u4_2;;
36*"ULTRIX V4."*)			OS=u4_0;;
37*"HLH OTS Version 1."*)		OS=hlh42;;
38*"RISC iX release 1."*)		OS=riscix;;
39*"FPX 4."*)			OS=fpx4;;
40*"HCX/UX"*)			OS=hcx;;
41*"4.4 BSD UNIX"*)		OS=bsd44;;
42*"4.3 BSD Reno UNIX"*)		OS=bsd44;;
43*"4.3 BSD UNIX"*)		if [ -f /etc/minidisk ]; then
44					OS=acis43
45				elif [ -f /sbin/nfsiod ]; then
46					OS=bsd44	# prototype
47				else
48					OS=xinu43
49				fi;;
50*"Alliant Concentrix"*)		OS=concentrix;;
51*"Umax 4.3"*)			OS=umax43;;
52*)
53#
54# Well, that didn't work so apply some heuristics
55# to the filesystem name space...
56#
57				echo "#	... inspecting File system ..." >&2
58				if [ -f /etc/comply ]; then
59					OS=utek
60				elif [ -d /usr/lib/methods -o -d /etc/methods ]; then
61					OS=aix3
62				elif [ -f /usr/bin/cat ]; then
63					OS=sos4
64				elif [ -f /etc/nd ]; then
65					OS=sos3
66				elif [ -f /etc/elcsd ]; then
67					echo "#	... Ultrix - assuming U4.0 ..." >&2
68					OS=u4_0
69				elif [ -f /hp-ux ]; then
70					OS=hpux
71				elif [ -f /etc/ttylocal ]; then
72					OS=xinu43
73				elif [ -f /etc/minidisk ]; then
74					OS=acis43
75				elif [ -f /etc/toolboxdaemon ]; then
76					OS=aux
77				elif [ -f /sbin/nfsiod ]; then
78					OS=bsd44
79				elif [ -d /vrm ]; then
80					OS=aix2
81				elif [ -f /bin/pyr ] && /bin/pyr; then
82					OS=pyrOSx
83				elif [ -d /NextApps ]; then
84					OS=next
85				elif [ -f /etc/gl/ucode ]; then
86					OS=irix3
87				elif [ -f /usr/gfx/ucode ]; then
88					OS=irix4
89				elif [ -f /stellix ]; then
90					OS=stellix
91				else
92					case "`(sh ../config/arch)2>/dev/null`" in
93					ibm032)    OS=acis43;;
94					aviion)    OS=dgux;;
95					*)	   OS=unknown;;
96					esac
97				fi;;
98esac
99
100echo "#	... OS appears to be \"${OS}\"" >&2
101echo "${OS}"
102exit 0
103