#!/bin/sh
#
# $Id: AudibleAlarm.in,v 1.6 2005/11/08 01:18:34 xunsun Exp $
#
# Description:	wrapper of OCF RA AudibleAlarm, based on original heartbeat RA.
#		See OCF RA AudibleAlarm for more information.
#
# Author:	Xun Sun <xunsun@cn.ibm.com> 
# Support:      linux-ha@lists.linux-ha.org
# License:      GNU General Public License (GPL)
# Copyright:	(C) 2005 International Business Machines

# Source function library.
. /etc/ha.d/resource.d//hto-mapfuncs

usage() {
	echo "Usage: $0 [node1 node2 ... ] {start|stop|restart|status}"
	echo "  The node list is an optional space delimited"
	echo "  list of hosts that should never sound the alarm."
	echo "$Id: AudibleAlarm.in,v 1.6 2005/11/08 01:18:34 xunsun Exp $";
}
# Get operation name, which is the last argument we are passed.
for arg in "$@"; do
    op=$arg
done

# See how we were called.
case "$op" in
   start|stop|restart|status)
	;;
   usage)
	usage; exit 0;;
   *)
	usage; exit 1;;
esac

nodelist=`echo $* | sed 's%'$op'$%%'`

ra_execocf  "rsc_id=AudibleAlarm" "rsc_type=AudibleAlarm" "provider=heartbeat" $op "nodelist=$nodelist"
