#!/bin/sh


# For RTI 4464327
# Get My BASEDIR

SUNWSCSAP_BASEDIR=`/usr/bin/pkgparam SUNWscsap BASEDIR`
CI_CONF_DIR=${SUNWSCSAP_BASEDIR}/SUNWscsap/sap_ci/etc
AS_CONF_DIR=${SUNWSCSAP_BASEDIR}/SUNWscsap/sap_as/etc

# The following directory is created by another package. So get
# the BASEDIR of the other package.
SUNWSCU_BASEDIR=`/usr/bin/pkgparam SUNWscu BASEDIR`
if [ "$SUNWSCU_BASEDIR" = "/" ]; then
        SUNWSCU_BASEDIR=""
fi
RTRDIR=${SUNWSCU_BASEDIR}/usr/cluster/lib/rgm/rtreg
# Remove the link from the RT repository directory

# Remove the link only if the file it links is not present
if [ ! -f $CI_CONF_DIR/SUNW.sap_ci_v2 ]; then
        rm -f $RTRDIR/SUNW.sap_ci_v2
fi
if [ ! -f $AS_CONF_DIR/SUNW.sap_as_v2 ]; then
        rm -f $RTRDIR/SUNW.sap_as_v2
fi

exit 0