#!/bin/sh
#
# Copyright (C) 1993 Sun Microsystems International
#
#
# Postremove script for SUNWcsr package, 101085-01 patch
#

if [ "${BASEDIR}" != "/" ]; then
	minor_perm=$BASEDIR/etc/minor_perm
	name_to_major=$BASEDIR/etc/name_to_major
else
	minor_perm=/etc/minor_perm
	name_to_major=/etc/name_to_major
fi

#
# Check for the existance of the llc1 driver. If it is there, remove it.
#

if grep llc1 ${name_to_major} >/dev/null 2>&1; then
	:
else
	exit 0
fi

if grep "llc1" $minor_perm >/dev/null 2>&1 ; then
	sed '/^clone:llc1/d' $minor_perm >/tmp/minor_perm
	mv $minor_perm ${minor_perm}.old
	mv /tmp/minor_perm /etc
fi

if grep "llc1" $name_to_major >/dev/null 2>&1 ; then
	echo "Unconfiguring the llc1 driver..."
	/usr/sbin/rem_drv "llc1"
	#
	# get rid of the device nodes because rem_drv does not.
	#
	rm -f /dev/llc1
	rm -f /devices/pseudo/clone:llc1
fi

exit 0

