#!/usr/bin/ksh
#
# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
# Use is subject to license terms.
#
#ident	"@(#)sv.cluster	1.7	05/01/06 SMI"

if [ ! -d /usr/sbin -o ! -d /usr/bin ]
then
	exit 1
fi

# Constants

SVBOOT=/usr/opt/SUNWesm/sbin/svboot

# Functions

# main program

if [[ ! -x $SVBOOT ]]
then
	echo "$0: cannot find $SVBOOT"
	exit 1
fi

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

case "$opt" in
'start')
	$SVBOOT -C "$2" -r
	;;

'stop')

	$SVBOOT -C "$2" -s
	;;

*)
	echo "Usage: $0 { start | stop } cluster_resource"
	exit 1
	;;
esac
