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.4 (Berkeley) 05/12/91 14# 15# $Id: os-type,v 5.2.1.5 91/05/07 22:20:32 jsp Alpha $ 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."*) 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 [ -f /usr/bin/cat ]; then 61 OS=sos4 62 elif [ -f /etc/nd ]; then 63 OS=sos3 64 elif [ -f /etc/elcsd ]; then 65 echo "# ... Ultrix - assuming U4.0 ..." >&2 66 OS=u4_0 67 elif [ -f /hp-ux ]; then 68 OS=hpux 69 elif [ -f /etc/ttylocal ]; then 70 OS=xinu43 71 elif [ -f /etc/minidisk ]; then 72 OS=acis43 73 elif [ -f /etc/toolboxdaemon ]; then 74 OS=aux 75 elif [ -f /sbin/nfsiod ]; then 76 OS=bsd44 77 elif [ -d /vrm ]; then 78 OS=aix2 79 elif [ -d /etc/aix ]; then 80 OS=aix3 81 elif [ -f /bin/pyr ] && /bin/pyr; then 82 OS=pyrOSx 83 elif [ -d /NextApps ]; then 84 OS=next 85 elif [ -f /usr/lib/libgl.a ]; then 86 OS=irix 87 else 88 case "`(sh ../config/arch)2>/dev/null`" in 89 ibm032) OS=acis43;; 90 aviion) OS=dgux;; 91 *) OS=unknown;; 92 esac 93 fi;; 94esac 95 96echo "# ... OS appears to be \"${OS}\"" >&2 97echo "${OS}" 98exit 0 99