#!/bin/sh
# ident "@(#)preremove	1.5 02/12/23 SMI"

SMCDIR=${PKG_INSTALL_ROOT}/usr/sadm/lib/smc

# test if the executable dtappintegrate is available  
if [ -x ${PKG_INSTALL_ROOT}/usr/dt/bin/dtappintegrate ]; then
    # it is, check for existence of usr/dt/appconfig and usr/sadm/lib/smc
    if [ -s ${PKG_INSTALL_ROOT}/usr/dt/appconfig -a -s ${SMCDIR} ]; then
        # run the cmd to un-integrate SMC from CDE
        ${PKG_INSTALL_ROOT}/usr/dt/bin/dtappintegrate -u -s ${SMCDIR} -t ${PKG_INSTALL_ROOT}/usr/dt/appconfig -l C
    fi
fi

exit 0
