#!/bin/sh
#
#
# License:      GNU General Public License (GPL)
# Support:      linux-ha@lists.linux-ha.org
#
#	This script is a test resource for introducing delay.
#
#	usage: $0  {start|stop|status|monitor}
#	usage: $0  delay {start|stop|status|monitor}
#	usage: $0  startdelay stopdelay {start|stop|status|monitor}
#
#	This is really a test resource script.
#

usage() {
  echo "usage: $0 [delay [stopdelay]] $LEGAL_ACTIONS"
  exit 1
}

. @HB_RA_DIR@/hto-mapfuncs

case $# in
  1)	op=$1;;
  2)	OCF_RESKEY_startdelay=$1; export OCF_RESKEY_startdelay; op=$2;;
  3)	OCF_RESKEY_startdelay=$1; 
	OCF_RESKEY_stopdelay=$2; 
	export OCF_RESKEY_startdelay OCF_RESKEY_stopdelay; 
	op=$3;;
  *)	usage;;
esac

if [ -z $OCF_RESKEY_startdelay ]; then
    OCF_RESKEY_startdelay=10
fi

OCF_TYPE=Delay
OCF_RESOURCE_INSTANCE=${OCF_TYPE}_${OCF_RESKEY_startdelay}
export OCF_TYPE OCF_RESOURCE_INSTANCE

ra_execocf $op
