1#!/bin/sh 2# 3# $Id: os-type,v 5.2.1.3 91/03/03 20:53:30 jsp Alpha $ 4# 5# Copyright (c) 1989 Jan-Simon Pendry 6# Copyright (c) 1989 Imperial College of Science, Technology & Medicine 7# Copyright (c) 1989 The Regents of the University of California. 8# All rights reserved. 9# 10# This code is derived from software contributed to Berkeley by 11# Jan-Simon Pendry at Imperial College, London. 12# 13# %sccs include.redist.sh% 14# 15# @(#)os-type 5.2 (Berkeley) 03/17/91 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-32 V3."*) OS=u3_0;; 34*"Ultrix Worksystem V2."*) OS=u3_0;; 35*"ULTRIX V4."*) OS=u4_0;; 36*"HLH OTS Version 1."*) OS=hlh42;; 37*"RISC iX release 1."*) OS=riscix;; 38*"FPX 4."*) OS=fpx4;; 39*"HCX/UX"*) OS=hcx;; 40*"4.4 BSD UNIX"*) OS=bsd44;; 41*"4.3 BSD Reno UNIX"*) OS=bsd44;; 42*"4.3 BSD UNIX"*) if [ -f /etc/minidisk ]; then 43 OS=acis43 44 elif [ -f /sbin/nfsiod ]; then 45 OS=bsd44 # prototype 46 else 47 OS=xinu43 48 fi;; 49*"Alliant Concentrix"*) OS=concentrix;; 50*"Umax 4.3"*) OS=umax43;; 51*) 52# 53# Well, that didn't work so apply some heuristics 54# to the filesystem name space... 55# 56 echo "# ... inspecting File system ..." >&2 57 if [ -f /etc/comply ]; then 58 OS=utek 59 elif [ -f /usr/bin/cat ]; then 60 OS=sos4 61 elif [ -f /etc/nd ]; then 62 OS=sos3 63 elif [ -f /etc/elcsd ]; then 64 echo "# ... Ultrix - assuming U4.0 ..." >&2 65 OS=u4_0 66 elif [ -f /hp-ux ]; then 67 OS=hpux 68 elif [ -f /etc/ttylocal ]; then 69 OS=xinu43 70 elif [ -f /etc/minidisk ]; then 71 OS=acis43 72 elif [ -f /etc/toolboxdaemon ]; then 73 OS=aux 74 elif [ -f /sbin/nfsiod ]; then 75 OS=bsd44 76 elif [ -d /vrm ]; then 77 OS=aix2 78 elif [ -d /etc/aix ]; then 79 OS=aix3 80 elif [ -f /bin/pyr ] && /bin/pyr; then 81 OS=pyrOSx 82 elif [ -d /NextApps ]; then 83 OS=next 84 elif [ -f /usr/lib/libgl.a ]; then 85 OS=irix 86 else 87 case "`(sh ../config/arch)2>/dev/null`" in 88 powernode) OS=utx32;; 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}" 98 * %sccs.include.redist.sh% 99exit 0 100