#! /bin/sh
#
# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
# Use is subject to license terms.
#
# ident	"@(#)preremove	1.4	08/01/14 SMI"
#
 
PATH="/usr/bin:/usr/sbin:${PATH}"
export PATH

EXIT=0

# only rem_drv ugen if there are no user-defined aliases and if actually
# installed

no_user_aliases() {
        driver=$1
        grep "^${driver} " $BASEDIR/etc/driver_aliases > /dev/null 2>&1

        return $?
}

if grep -w ugen ${BASEDIR}/etc/name_to_major > /dev/null 2>&1
then
	no_user_aliases ugen || rem_drv -b ${BASEDIR} ugen || EXIT=1
fi

exit $EXIT
