#!/bin/sh
#
# $Revision: 1.4 $ $Date: 2012-07-26 17:11:49-04 $
# $Source: /home/vogelke/bin/RCS/sparcinfo,v $
# $Host: sys7.com $
# $UUID: ade56cb1-d31b-3d3a-9289-19a524d0a41c $
#
#<sparcinfo: describe hardware setup

PATH=/bin:/usr/bin:/usr/sbin; export PATH

# print the version.
lsedscr='s/RCSfile: //
s/.Date: //
s/,v . .Revision: /  v/
s/\$//g'

lrevno='$RCSfile: sparcinfo,v $ $Revision: 1.4 $'
lrevdate='$Date: 2012-07-26 17:11:49-04 $'
echo "$lrevno $lrevdate" | sed -e "$lsedscr"

tmp=/tmp/sparcinfo$$
name="`uname -i`"
/usr/platform/$name/sbin/prtdiag -v > $tmp

# print the hardware setup.
echo
echo Output from /usr/platform/$name/sbin/prtdiag -v:
echo

(
    set X `grep 'System Configuration:' $tmp`
    shift
    echo $1 $2
    shift; shift
    echo "  $*"

    grep -v 'System Configuration:' $tmp

) | sed -e 's/^/    /g' | cut -c1-80 | uniq

rm -f $tmp
exit 0
