#############################################################################
# Copyright (C)2004-2005, Sun Microsystems Inc. All rights reserved.
# Use is subject to license terms.
#
# Name: disable
# Description: disable script for SUNWccccfg 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:45 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

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

    $log Destroying the initd entry for ccragent
    `/usr/lib/cc-cfw/framework/lib/get_interface DESTROY_INITD_ENTRY`  $executable_script $runlevel_file
    
    $log Setting the status to disabled for  ccragent
    `/usr/lib/cc-cfw/framework/lib/get_interface SET_COMPONENT_STATUS`  platform ccragent disabled

}

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

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

removeinitdentry

exit 0

