Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!olivea!uunet!island!daniel From: daniel@island.COM (Daniel Smith "innovation, not litigation...") Newsgroups: comp.unix.admin Subject: Re: what kind of machine am I Message-ID: <4035@island.COM> Date: 9 May 91 21:00:29 GMT References: <858@lhdsy1.chevron.com> Distribution: na Organization: Island Graphics, Marin County, California Lines: 57 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@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@island.com Daniel Smith, Island Graphics, (415) 491 0765 x 250(w) daniel@world.std.com 4000 CivicCenterDrive SanRafael MarinCounty CA 94903 dansmith@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