#!/bin/ksh93
# IBM_PROLOG_BEGIN_TAG 
# This is an automatically generated prolog. 
#  
# 61haes_r714 src/43haes/usr/sbin/cluster/utilities/Kcluster.sh 1.1 
#  
# Licensed Materials - Property of IBM 
#  
# COPYRIGHT International Business Machines Corp. 2014 
# All Rights Reserved 
#  
# US Government Users Restricted Rights - Use, duplication or 
# disclosure restricted by GSA ADP Schedule Contract with IBM Corp. 
#  
# IBM_PROLOG_END_TAG 

##################################################
# name: Kcluster
# inputs: should only be start or stop. start is nop
# returns: 1 for Usage, otherwise returns 0
# purpose: stop IBM.ConfigRM at system shutdown
##################################################

case "$1" in
start )
	# There is no need to start.
	exit 0
	;;

stop )
	CLNAME=$(/usr/sbin/rsct/bin/ct_clusterinfo -c)
	if [[ -n $CLNAME && $CLNAME != "IW" ]]; then
 		# just to make sure that HAGS won't trigger the
		# critical action (if it is still running)
		echo "Quiescing cthags..."
 		/usr/sbin/rsct/bin/hags_disable_client_kill -s cthags
		echo "Stopping IBM.ConfigRM..."
 		stopsrc -s IBM.ConfigRM
		exit 0
	fi
	;;

* )
	echo "Usage: $0 (start | stop)"
	exit 1
esac
exit 0
