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

typeset opt

while getopts 'R:G:Q:U:' opt
do
	case "$opt" in
		R)      RESOURCE=$OPTARG;;
                G)	RESOURCEGROUP=$OPTARG;;
		Q)      QMGR=$OPTARG;;
		U)      USERID=$OPTARG;;
	        *) 	logger -p daemon.err \
                        "ERROR: `basename $0` Option $OPTARG unknown"
                        exit 1
                        ;;
	esac
done
    
. `dirname $0`/../etc/config
. `dirname $0`/functions

validate_options

debug_message "Method: `basename $0` - Begin"
$SET_DEBUG

# Although PMF will handle the process restart, this test is simply
# performed to ensure the STATUS is set correctly.

if ps -u mqm -o pid,args | eval /usr/xpg4/bin/grep -E '$PATTERN' |\
	grep -w amqpcsea > /dev/null
then
	set_status OK
else
	debug_message "Method: `basename $0` - End (Exit 100)"
	exit 100
fi

debug_message "Method `basename $0` - End (Exit 0)"
exit 0
