#!/usr/bin/ksh
#
# Copyright 2001 Sun Microsystems, Inc.  All rights reserved.
#
# SNDR start script
#
# Description:	This is the SNDR switchover script.
#		It is used to start or stop a specified cluster
#		resource group when invoked from the data service cluster
#		failover script.
#
#ident  "@(#)rdc.cluster 1.6     03/04/23 SMI"
#

PATH=/etc:/bin
RDCBIN="/usr/opt/SUNWesm/SUNWrdc/sbin"
RDCLIB="/usr/opt/SUNWrdc/lib"
RDCBOOT="$RDCBIN/sndrboot"
RDCSYNCD="${RDCLIB}/sndrsyncd"
USAGE="Usage: $0 {start|stop} cluster_resource"

if [[ -z "$2" ]]
then
	echo "$USAGE"
	exit 1
fi

case "$1" in
'start')
	if [[ -x $RDCBOOT ]]
	then
		$RDCBOOT -r -C "$2"
	fi
	;;

'stop')
	if [[ -x $RDCBOOT ]]
	then
		$RDCBOOT -s -C "$2"
	fi
	;;

*)
	echo $USAGE
	exit 1
	;;
esac
