head	1.6;
access;
symbols;
locks; strict;
comment	@# @;


1.6
date	95.10.22.01.45.59;	author yoav;	state Exp;
branches;
next	1.5;

1.5
date	95.03.29.23.42.47;	author ghudson;	state Exp;
branches;
next	1.4;

1.4
date	95.03.05.23.13.47;	author ghudson;	state Exp;
branches;
next	1.3;

1.3
date	95.02.26.04.20.23;	author jhawk;	state Exp;
branches;
next	1.2;

1.2
date	95.01.09.19.56.01;	author jhawk;	state Exp;
branches;
next	1.1;

1.1
date	95.01.09.19.52.44;	author yoav;	state Exp;
branches;
next	;


desc
@Initial version.
@


1.6
log
@added more "athenized" memory report, and also made it report the server if it can
@
text
@#!/bin/sh
# $Id: machtype,v 1.3 1995/02/26 04:20:23 jhawk Exp $
# $Source: /afs/sipb/project/netbsd/dev/athena/machtype/RCS/machtype,v $

# need to support the following options:
# NOTE, c, v, d, and M are needed by olc, do not change them a TINY bit!!!
#  -c     : Processor type
#  -d     : display type 
#  -k     : select the kernel
#  -m     : override memory from /dev/kmem
#  -r     : disk drive type
#  -v     : more verbose -- about memory mainly
#  -A     : print Athena Release
#  -E     : print out the version of the Base OS
#  -L     : version of athena from /etc/athena/version
#  -M     : free memory
#  -N     : print out the name of the base OS
#  -P     : print out Athena System packs (from /srvd/.rvdinfo)
#  -S     : Print out the Athena System name  (AFS sysname)

PATH=/bin:/usr/bin
set -- `getopt cdk:m:rvAELMNPS $*`
if test $? != 0
then
	echo 'Usage: machtype [-cdrvAELMNPS] [-k kernel] [-m memsource]'
	exit 2
fi
for i
do
	case "$i"
	in
		-c)
			cpu=1;shift;;
		-d)
			display=1; shift;;
		-k)
				kernel=1; karg=$2; shift 2;;
		-m)
			mem=1; memarg=$2; shift 2;;
		-r)
			rdsk=1; shift;;
		-v)
			verbose=1; shift;;
		-A)
			at_rel=1; shift;;
		-E) 	
			base_os_ver=1; shift;;
		-L)
			ath_vers=1; shift;;
		-M)
			memory=1; shift;;
		-N)
			base_os_name=1; shift;;		
		-P)	
			syspacks=1; shift;;
		-S)
			ath_sys_name=1; shift;;
		--)
			shift; break;;
	esac
done
printed=0

if [ $cpu ] ; then
	if [ $verbose ]; then
		echo "`/usr/sbin/sysctl -n kern.ostype` `/usr/sbin/sysctl -n kern.osrelease` on `/usr/sbin/sysctl -n hw.model`"
	else
		/usr/sbin/sysctl -n hw.model | tr \\040 _
	fi
	printed=1
fi

if [ $display ] ; then
	echo "XFree3.1_`ls -l /etc/X | awk -F_ '/->/{print $NF}'`"
	printed=1
fi

if [ $memory ] ; then
	if [ $verbose ]; then
		/usr/sbin/sysctl -n hw.usermem | awk '{printf "user=%d, ", $1/1000}'
		/usr/sbin/sysctl -n hw.physmem | awk '{printf "phys=%d (%d M)\n", $1/1000, $1/1024000}'
	else
		/usr/sbin/sysctl -n hw.physmem | awk '{printf "%d\n", $1/1000}'
	fi
	printed=1
fi

if [ $at_rel ]; then
	cat /etc/athena/version
	printed=1
fi

if [ $ath_vers ]; then
	cat /etc/athena/version
	printed=1
fi

if [ $base_os_ver ]; then
	/usr/sbin/sysctl -n kern.osrelease
	printed=1
fi

if [ $base_os_name ]; then
	/usr/sbin/sysctl -n kern.osname
	printed=1
fi

if [ $ath_sys_name ]; then
	/bin/athena/fs sysname | awk -F\' '{ print $2 }'
	printed=1
fi

if [ $printed -eq '0' ] ; then
	echo inbsd
fi
exit 0
@


1.5
log
@kern.osname doesn't exist; use kern.ostype.
@
text
@d2 2
a3 2
# $Id: machtype,v 1.4 1995/03/05 23:13:47 ghudson Exp ghudson $
# $Source: /mit/netbsd/dev/athena/machtype/RCS/machtype,v $
d74 1
a74 1
	echo "XFree3.1"
d80 2
a81 1
		echo "`/usr/sbin/sysctl hw.usermem` `/usr/sbin/sysctl hw.physmem`"
d83 1
a83 1
		echo "`/usr/sbin/sysctl -n hw.usermem` `/usr/sbin/sysctl -n hw.physmem`"
d104 1
a104 1
	/usr/sbin/sysctl -n kern.ostype
@


1.4
log
@Add code to print sysname on -S.
@
text
@d2 2
a3 2
# $Id: machtype,v 1.3 1995/02/26 04:20:23 jhawk Exp $
# $Source: /afs/sipb/project/netbsd/dev/athena/machtype/RCS/machtype,v $
d103 1
a103 1
	/usr/sbin/sysctl -n kern.osname
@


1.3
log
@Moved from lola-granola.mit.edu:/usr/bin/RCS/machtype,v to
/afs/sipb/project/netbsd/dev/athena/machtype/RCS/machtype,v.

Changed machtype -c to output one word (tr spaces to _'s).
@
text
@d2 2
a3 2
# $Id: machtype,v 1.2 1995/01/09 19:56:01 jhawk Exp jhawk $
# $Source$
d104 5
@


1.2
log
@Fixed PATH.
@
text
@d2 2
a3 1
# $Id$
d68 1
a68 1
		/usr/sbin/sysctl -n hw.model
@


1.1
log
@Initial revision
@
text
@d2 1
d20 1
@
