#!/bin/sh
#
# ident "@(#)preremove	1.2 03/03/29 SMI"
#
# Copyright 2001-2002 Sun Microsystems, Inc.  All rights reserved.
#

# preremove script for SUNWutscr - Sun Ray smartcard APIs

# if PKG_INSTALL_ROOT is not assigned from the env then
# set it to an empty string, set -u in effect below
#
if [ -z "$PKG_INSTALL_ROOT" ]; then
	PKG_INSTALL_ROOT=""
fi

set -u

SUNWUTLIB="${PKG_INSTALL_ROOT}${BASEDIR}/SUNWut/lib"

OCF_CP_FILE="/etc/smartcard/ocf.classpath"

CT_JAR="${SUNWUTLIB}/sunrayCTdriver.jar"
CT_JAR_BASE="`/bin/basename $CT_JAR`"

TMP="/tmp/$$.SUNWutscr"

    egrep -vi $CT_JAR_BASE $OCF_CP_FILE >$TMP
    mv $TMP $OCF_CP_FILE

    exit 0
