#!/sbin/sh
#############################################################################
#  Product: HSCFibreCh
#  Fileset: FCHSC-KRN
#  verify
#  @(#) $Revision: 1.1.98.2 $
#############################################################################
# (c) Copyright Hewlett-Packard Company, 1994
#############################################################################

####### setup environment 
PATH=${SW_PATH}:${SW_ROOT_DIRECTORY}usr/lbin/sw
UTILS="/usr/lbin/sw/control_utils"
if [ ! -f $UTILS ] ; then
        echo "ERROR:   Cannot find \"$UTILS\"."
        exit 1

fi
. $UTILS

EXITVAL=0

####### For now, do something only if this is a Series 800 machine

ARCHITECTURE=`get_arch`
if [ $ARCHITECTURE -ne "800" ]; then
    exit $SUCCESS
fi

####### make sure files were installed correctly
FILES=" usr/conf/lib/libfcgsc.a "

for FILE in $FILES ; do
	FNAME=${SW_ROOT_DIRECTORY}${FILE}
	if [ ! -f "$FNAME" ] ; then
		echo "ERROR:   The kernel library \"$FNAME\""
		echo "         is not installed correctly."
		EXITVAL=1
	fi
done


####### make sure the driver was installed in the kernel
TFILE=/tmp/fcgsc_krn_verify$$
if [ -f "$SW_KERNEL_PATH" ] ; then
    rm -rf $TFILE
    /usr/lbin/sysadm/get_sysfile $SW_KERNEL_PATH > $TFILE
    RES=$?
    if [ $RES -eq 0 ] ; then
	if [ -z "`grep ^fcgsc_lan $TFILE `" ] ; then
          echo "ERROR:   No fcgsc driver is configured into \"$SW_KERNEL_PATH\"."
	  EXITVAL=1
	fi
    else
	echo "ERROR:   Cannot read configuration information"
	echo "         from \"$SW_KERNEL_PATH\"."
       EXITVAL=1
    fi
else
    echo "ERROR:   Kernel not present at \"$SW_KERNEL_PATH\".  Cannot read"
    echo "         configuration information."
    EXITVAL=1
fi

rm -f $TFILE
exit $EXITVAL
