#!/bin/sh 

# A boilerplate postpatch script for SMC-based tools.  This exact same script
# would also be used for a postbackout script, as once the previous files
# are restored, all that is required is to re-register them and restart
# the server.
#
# Note:  This script can only be used to patch SMC2.1-based tools in Solaris 9
# or greater.  It can NOT be used with SMC 2.0 on Solaris 8.

SMCREG=${ROOTDIR}/usr/sadm/bin/smcregister
ADMIN_LIBDIR=${ROOTDIR}/usr/sadm/lib
export ROOTDIR

# If SMC repository doesn't exist, server was never started,
# so no need to create registration requests.  Instead, the
# tool's registration script will make the registration requests.
if [ ! -d ${ROOTDIR}/var/sadm/smc ]; then
    exit 0
fi


# Register tools and services
if [ -f ${SMCREG} -a "${ROOTDIR}" = "/" ]; then
    # Add here the same commands you would see in the tool's
    # registration script at /usr/sadm/lib/smc/prereg/<PKG>/<PKG>_reg.sh
    ${SMCREG} tool -n com.sun.admin.projmgr.client.VProjMgr.jar \
        ${ADMIN_LIBDIR}/projmgr/VProjMgr.jar \
        ${ADMIN_LIBDIR}/projmgr/VProjMgr_classlist.txt \
        ${ADMIN_LIBDIR}/projmgr/VProjMgrInfo.xml


fi

# Restart SMC/WBEM server, but only if it is currently running,
# as we don't want to blatantly start servers on the customer.

exit 0
