#!/bin/sh
#
# 
# Description:	wrapper of OCF RA LinuxSCSI, based on original heartbeat RA.
#		See OCF RA LinuxSCSI 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
#
# CAVEATS:	See the usage message for some important warnings
#
# usage: ./LinuxSCSI <host>:<channel>:<target>[:<lun>] {start|stop|status}
#
#<host>:	Host adapter number of the SCSI device to query
#<channel>:	SCSI channel
#<target>:	Target ID of the SCSI device under consideration
#<lun>:		LUN of the SCSI device under consideration
#			(optional)
#
#
# An example usage in /etc/ha.d/haresources: 
#       node1  10.0.0.170 LinuxSCSI:0:0:11 
#
. @HB_RA_DIR@/hto-mapfuncs

usage() {
    echo "usage: $0  <host>:<channel>:<target>[:<lun>] $LEGAL_ACTIONS"
    exit 1
}

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

OCF_TYPE=LinuxSCSI
OCF_RESOURCE_INSTANCE=${OCF_TYPE}_$1
export OCF_TYPE OCF_RESOURCE_INSTANCE

OCF_RESKEY_scsi=$1; export OCF_RESKEY_scsi
ra_execocf $2
