#! /bin/sh
#############################################################################
# Copyright (C)2004-2005, Sun Microsystems Inc. All rights reserved.
# Use is subject to license terms.
#
# Name: preremove
# Description: preremove for SUNWccfwctrl pkg.
#
# pragma ident	"$Id: preremove,v 1.2.2.2 2005/04/08 21:16:30 mc137394 Exp $"
##############################################################################

################################################################################
#  Function of preremove
#  1. check to see if this package instance is the possibly running one:
#     if PKG_INSTALL_ROOT is set, it cannot be.
#
#  2. if it is possibly the running instance, call the component disable script
#     to allow it to clean up any state prior to continuing with package removal
#
#  3. ignore the disable script's exit code
################################################################################

if [ $PKG_INSTALL_ROOT ] && [ -n $PKG_INSTALL_ROOT ] ; then
    exit 0
fi

###  locate and run the disable script ###
disable_script="${BASEDIR}/lib/cc-cfw/platform/fwagent/disable"
if [ -x ${disable_script} ] ; then
    ### ignore exit code  
    ${disable_script} > /dev/null 2>&1
fi

exit 0
