#       @(#)postinstall	1.8     94/05/26 (c) Sun Microsystems, Inc.
# Postinstallation script for SUNWbmac
BARG=""

if [ "$BASEDIR" != "" -a "$BASEDIR" != "/" ]; then
	BARG="-b ${BASEDIR}"
fi

# double check for previous added versions, and remove them
grep be ${BASEDIR}/etc/name_to_major > /dev/null 2>&1
if [ $? -eq 0 ]; then
	/usr/sbin/rem_drv ${BARG} be
fi

# add driver
# use of ${BARG} and ${BASEDIR} insure this script will work anywhere
# check to see if the board exists on the system or not
prtconf | grep '[ 	]be' > /dev/null 2>&1
if [ $? -eq 0 ]; then
	/usr/sbin/add_drv ${BARG} -m '* 0755 root sys' \
		${BASEDIR}/kernel/drv/be > /dev/null 2>&1
fi

STATUS=$?
if [ $STATUS -ne 0 ]; then
	exit 2
fi

exit 0
