#! /bin/csh -f

#
# looks like we're going to do something.  shutdown the FW now.
#
source scripts/aliases


	if (-x $FWDIR/bin/fwstop) then
		E ""
		if ("X$ans" != "Xc") then
			E "Shutting down $product"
		else
			E "Shutting down $product daemon"
		endif
		$FWDIR/bin/fwstop >& /dev/null

		if ($solaris2 && ("X$ans" != "Xc")) then
			egrep -s fw /etc/name_to_major
			if ($status == 0) then
				E "Removing old FW-1 kernel module"
				/usr/sbin/rem_drv fw
				/usr/sbin/modinfo | grep fw >& /dev/null
				if ($status == 0) then
					echo "FW-1 OLD KERNEL MODULE COUND NOT BE REMOVED"
					echo "ABORTING INSTALLATION"
					exit 1
				endif
				/bin/rm -f /usr/kernel/drv/fw \
					/usr/kernel/drv/fw.conf >& /dev/null
			endif
		endif
	endif
	exit 0
