# Copyright 1993 Sun Microsystems, Inc.  All Rights Reserved.
#
# Copyright 1993 Sun Microsystems, Inc. All Rights Reserved
#
# postinstall: SunLink BSC drivers
#
pidproc() {
pid=`/usr/bin/ps -e | /usr/bin/grep $1 | /usr/bin/sed -e's/^ *//' -e's/ .*//'`
}

#
# 10-12-94 lta
#
# adding support for two different versions of zsb.
# if this is release 5.3 or lower, we will use the standard
# zsb version.  however, if this is release 5.4 or above,
# we will use the zsb_2.4 version.  in both cases, the
# version we use is named zsb and the other version
# is removed.
#

#
#  03/29/96 lta
#
#  Modified to support three versioins of zsb (2.0-2.3, 2.4, and 2.5).
#
REL=`uname -r`
if [ $REL = "5.0" ]; then
	echo "This appears to be a SunOS 5.0 system.  Using Solaris 2.0 version of zsb."
	rm -f /kernel/drv/zsb_2.4
	rm -f /kernel/drv/zsb_2.5
elif [ $REL = "5.1" ]; then
	echo "This appears to be a SunOS 5.1 system.  Using Solaris 2.1 version of zsb."
	rm -f /kernel/drv/zsb_2.4
	rm -f /kernel/drv/zsb_2.5
elif [ $REL = "5.2" ]; then
	echo "This appears to be a SunOS 5.2 system.  Using Solaris 2.2 version of zsb."
	rm -f /kernel/drv/zsb_2.4
	rm -f /kernel/drv/zsb_2.5
elif [ $REL = "5.3" ]; then
	echo "This appears to be a SunOS 5.3 system.  Using Solaris 2.3 version of zsb."
	rm -f /kernel/drv/zsb_2.4
	rm -f /kernel/drv/zsb_2.5
elif [ $REL = "5.4" ]; then
	echo "This appears to be a SunOS 5.4 system.  Using Solaris 2.4 version of zsb."
	mv -f /kernel/drv/zsb_2.4 /kernel/drv/zsb
	rm -f /kernel/drv/zsb_2.5
else
	echo "This appears to be a SunOS 5.5 or later system.  Using Solaris 2.5 version of zsb."
	mv -f /kernel/drv/zsb_2.5 /kernel/drv/zsb
	rm -f /kernel/drv/zsb_2.4
fi


pidproc bsc3274
[ "$pid" != "" ] && kill -HUP $pid
	/usr/sbin/modunload -i 0
	/usr/sbin/add_drv -m'* 0666 bin bin' zsb || exit 2
	/usr/sbin/devlinks || exit 2
exit 0
