#############################################################################
# Copyright (C)2004-2005, Sun Microsystems Inc. All rights reserved.
# Use is subject to license terms.
#
# Name: disable
# Description: disable script for SUNWccfwctrl pkg. This script is required
# of any package which conforms to the Client Framework and is a daemon
# agent.

# pragma ident	"$Id: disable.sh,v 1.2.2.1 2005/03/12 01:13:46 sd148285 Exp $"
##############################################################################

################################################################################
#  Function of the disable script 
#  1.  Remove the init.d entry from the crontab
#  2.  Clean up the directories.
#################################################################################

user="root"

fw_pkg="SUNWccfw"

removeinitdentry()
{
   
    ###
    ##  Check for the presence of the Configuration Framework Package
    ###

    pkginfo $fw_pkg > /dev/null
    if [ $? -ne 0 ] ; then
        $log "postinstall ERROR : The Framework Package  $fw_pkg is not available."
        $log "postinstall ERROR : Please install $fw_pkg and retry "
        exit 1
    fi

    ###
    ## Invoking the destroy_init entry function with the executable script
    ###

    ##  Send in the path to the executable and the runlevel
    runlevel_file=/usr/lib/cc-cfw/platform/fwagent/runlevel
    executable_script=/usr/lib/cc-cfw/platform/fwagent/cc-fwagent

    $log Destroying the initd entry for fwagent
    `/usr/lib/cc-cfw/framework/lib/get_interface DESTROY_INITD_ENTRY` $executable_script $runlevel_file

    $log Setting the status to disabled for  fwagent
    `/usr/lib/cc-cfw/framework/lib/get_interface SET_COMPONENT_STATUS`  platform fwagent disabled

}

######### Main function #########

#
# control logging method
#
log=echo
#log="logger -pdaemon.err"

removeinitdentry
exit 0

