#!/usr/bin/ksh
#
# Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
# Use is subject to license terms.
#

MYNAME=`basename ${0}`
MYDIR=`dirname ${0}`

# stop the zone

typeset opt

while getopts 'R:G:P:' opt
do
        case "${opt}" in
                R)      RESOURCE=${OPTARG};;
                G)      RESOURCEGROUP=${OPTARG};;
                P)      PARDIR=${OPTARG};;
                *)      logger -p daemon.err \
                        "ERROR: ${MYNAME} Option ${OPTARG} unknown"
                        exit 1;;
        esac
done

. ${MYDIR}/../etc/config 		# debugging flags
. ${MYDIR}/functions			# agent specific functions
. ${MYDIR}/../../lib/functions		# functions common for all the agents
. ${MYDIR}/../../lib/functions_common	# functions common for all the zone components

debug_message "Method: ${MYNAME} - Begin"
${SET_DEBUG}

# check the syntax of the options

if ! validate_options
then
        debug_message "Method: ${MYNAME} - End (Exit 1)"
        exit 1
fi

rm ${LOGFILE} 2>/dev/null

# source the zoneboot specific parameter file
. ${PARFILE}

if stop_sczbt
then
        log_message notice "stop_command"
        debug_message "Method: ${MYNAME} - End (Exit 0)"
        exit 0
else
        log_message err "stop_command"
fi

debug_message "Method: ${MYNAME} - End (Exit 0)"
exit 0
