Current File : //etc/init.d/ii.cluster
#!/usr/bin/ksh
#
# Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
#
CMD=/usr/sbin/iiboot
SVCS=/usr/bin/svcs
SVCS_NAME=system/nws_ii:cluster

# Determine if SMF service is online
#
ONLINE=`$SVCS -D $SVCS_NAME 2>>/dev/null | grep "^online"`
if [ -z $ONLINE ]
then
	echo "$SVCS_NAME not online"
	exit 1
fi

if [[ -z "$2" ]]
then
	opt=usage
else
	opt=$1
fi

case $opt in
'start')
	if [[ -x $CMD ]]
	then
		$CMD -C "$2" -r > /dev/null 2>&1
	fi
	;;

'stop')
	if [[ -x $CMD ]]
	then
		$CMD -C "$2" -s > /dev/null 2>&1
	fi
	;;

*)
	echo "usage: ii {start|stop} cluster_resource"
	;;
esac