xref: /openbsd/usr.sbin/mopd/otherOS/ostype (revision d89ec533)
1#!/bin/sh
2#
3# @(#) $OpenBSD: ostype,v 1.3 1999/03/27 14:31:23 maja Exp $
4#
5# Determine os type.
6#
7os="UNKNOWN"
8
9if [ -f /usr/bin/uname ]; then
10
11    osname=`/usr/bin/uname`
12
13    if [ $osname = "AIX" ]; then
14	os="aix`/usr/bin/uname -v`"
15    fi
16
17    if [ $osname = "SunOS" ]; then
18	os="sunos`/usr/bin/uname -r | /usr/bin/cut -c1`"
19    fi
20
21    if [ $osname = "NetBSD" ]; then
22	os="netbsd"
23    fi
24
25fi
26
27if [ -f /bin/uname ]; then
28
29    osname=`/bin/uname`
30
31    if [ $osname = "Linux" ]; then
32	os="linux`/bin/uname -r | /usr/bin/cut -d. -f1`"
33    fi
34
35fi
36
37echo $os
38
39if [ $os = "UNKNOWN" ]; then
40    exit 1
41else
42    exit 0
43fi
44