#!/bin/sh
#
#
# Description:	wrapper of OCF RA portblock, based on original heartbeat RA.
#		See OCF RA portblock 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
#

. @HB_RA_DIR@/hto-mapfuncs
usage()
{
    echo "usage: $0 {udp|tcp} portno,portno {block|unblock} $LEGAL_ACTIONS"
    exit 1
}

if [ $# != 4 ]; then
    usage
fi

OCF_RESKEY_protocol=$1
OCF_RESKEY_portno=$2
OCF_RESKEY_action=$3
export OCF_RESKEY_protocol OCF_RESKEY_portno OCF_RESKEY_action

OCF_TYPE=portblock
OCF_RESOURCE_INSTANCE=${OCF_TYPE}_$1_$2_$3
export OCF_TYPE OCF_RESOURCE_INSTANCE

ra_execocf $4 
