what kind of machine am I

Daniel Smith "innovation, not litigation..." daniel at island.COM
Fri May 10 07:00:29 AEST 1991


	I posted this a while back, you can use it as a start... you
just need to figure out what is different about a dec or whatever, and
add the appropriate lines.  It's derived from the sun "arch" command.
It's better to have each machine have some sort of database in one place,
like Karl K. mentioned, but if you're dealing with "stock" systems, then
you need to take this approach (query after query...)

				Daniel

#! /bin/sh
#
#	whicharch - what machine am I on?
#	daniel at island.com (Please send me any extensions to this)
#
if [ -f /bin/sun4c ] && /bin/sun4c; then
        echo sun4
elif [ -f /bin/sun4 ] && /bin/sun4; then
	echo sun4
elif [ -f /bin/sun3 ] && /bin/sun3; then
	echo sun3
elif [ -f /bin/sun3x ] && /bin/sun3x; then
	echo sun3
elif [ -f /bin/sun386 ] && /bin/sun386; then
	echo sun386
elif [ -f /bin/sun2 ] && /bin/sun2; then
	echo sun2
elif [ -f /bin/hp9000s200 ] && /bin/hp9000s200; then
	echo hp300
elif [ -f /bin/hp9000s300 ] && /bin/hp9000s300; then
	echo hp300
elif [ -f /bin/hp9000s500 ] && /bin/hp9000s500; then
	echo hp500
elif [ -f /bin/hp9000s800 ] && /bin/hp9000s800; then
	echo hp800
elif [ -f /bin/4d ] && /bin/4d; then
	echo sgi
elif [ -f /bin/i286 ] && /bin/i286; then
	echo 286
elif [ -f /bin/i386 ] && /bin/i386; then
	echo 386
elif [ -f /bin/i486 ] && /bin/i486; then
	echo 486
elif [ -f /bin/i586 ] && /bin/i586; then
	echo 586
elif [ -f /usr/bin/X11/aixterm ] ; then
	echo ibm
elif [ -f /com/lvolfs ] ; then
	echo ${NODETYPE+apollo}
else
	echo unknown
fi
-- 
daniel at island.com       Daniel Smith, Island Graphics, (415) 491 0765 x 250(w)
daniel at world.std.com      4000 CivicCenterDrive SanRafael MarinCounty CA 94903
dansmith at well.sf.ca.us      Fax: 491 0402 Disclaimer: Hey, I wrote it, not IG!
falling/yes I'm falling/and she keeps calling/me back again - IJSaF, Beatles



More information about the Comp.unix.admin mailing list