1#!/bin/sh 2# 3# $Id: os-type,v 5.2 90/06/23 22:21:23 jsp Rel $ 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.1 (Berkeley) 06/29/90 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-32 V3."*) OS=u3_0;; 33*"Ultrix Worksystem V2.0"*) OS=u3_0;; 34*"HLH OTS Version 1."*) OS=hlh42;; 35*"RISC iX release 1."*) OS=riscix;; 36*"FPX 4."*) OS=fpx4;; 37*"4.4 BSD UNIX"*) OS=bsd44;; 38*"4.3 BSD UNIX"*) if [ -f /etc/minidisk ]; then 39 OS=acis43 40 elif [ -f /sbin/nfsiod ]; then 41 OS=bsd44 # prototype 42 else 43 OS=xinu43 44 fi;; 45*"Alliant Concentrix"*) OS=concentrix;; 46*"Umax 4.3"*) OS=umax43;; 47*) 48# 49# Well, that didn't work so apply some heuristics 50# to the filesystem name space... 51# 52 echo " ... inspecting File system ..." >&2 53 if [ -f /usr/bin/cat ]; then 54 OS=sos4 55 elif [ -f /etc/nd ]; then 56 OS=sos3 57 elif [ -f /etc/elcsd ]; then 58 echo " ... Ultrix - assuming U3.0 ..." >&2 59 OS=u3_0 60 elif [ -f /hp-ux ]; then 61 OS=hpux 62 elif [ -f /etc/ttylocal ]; then 63 OS=xinu43 64 elif [ -f /etc/minidisk ]; then 65 OS=acis43 66 elif [ -f /etc/toolboxdaemon ]; then 67 OS=aux 68 elif [ -f /sbin/nfsiod ]; then 69 OS=bsd44 70 elif [ -d /vrm ]; then 71 OS=aix2 72 elif [ -d /etc/aix ]; then 73 OS=aix3 74 elif [ -f /bin/pyr ] && /bin/pyr; then 75 OS=pyrOSx 76 else 77 case "`(sh arch)2>/dev/null`" in 78 powernode) OS=utx32;; 79 ibm032) OS=acis43;; 80 *) OS=unknown;; 81 esac 82 fi;; 83esac 84 85echo " ... OS appears to be \"${OS}\"" >&2 86echo "${OS}" 87exit 0 88