#!/bin/sh
#@(#)ssa	1.13 12/03/98 00:42:59


if [ -x /usr/sbin/luxadm ]
then
    SSAADM=/usr/sbin/luxadm
else
    SSAADM=`which ssaadm`
fi

export SSAADM

status="first"

# check for the existence of ssa devices in /dev/rdsk, and pull the
# cNtNdN numbers
# NOTE: that this doesn't mean that an SSA is currently installed on
#       that device. To be sure, I can pull this info from format, but
#	I am concerned that if format gets stuck for some reasone, then
#	the whole script will get stck too. This can be fixed when I
#	process the data. At that point I will match the info from
#	format agianst the disks in here.
for xxx in `ls -l /dev/rdsk/ | grep \/SUNW,pln | grep s0 | nawk '{ print $9 }' | sed s/t.\*//| sort -u`
do
    # create the dir only the first time around
    if [ "$status" = "first" ]
    then
	mkdir disks/ssa
	status="fales"
    fi
    $SSAADM -v display $xxx 1>disks/ssa/ssaadm."$xxx".out 2>&1
    mkdir disks/ssa/$xxx.disk_list

    for diskpath in `ls /dev/rdsk/"$xxx"t*s0`
    do
        diskname=`echo $diskpath | sed s/.dev.rdsk.//`
	$SSAADM  display $diskpath 1>disks/ssa/$xxx.disk_list/$diskname 2>&1
    done
done
