#!/bin/sh
#
. /opt/HAC/bin/rsf.sh

WITH_LOCK=${PRODUCT_BIN}/with_lock
PIDFILE=/tmp/S98iscsi_linux.pid
PYTHON="/opt/HAC/RSF-1/bin/python"
PYCMD="/opt/HAC/RSF-1/lib/python/S98iscsi_linux.pyc"

service=${RSF_SERVICE:-"service_name"}
script="`basename $0`"
action=$1
attempt=$2
CMD="${WITH_LOCK} ${PIDFILE} ${PYTHON} ${PYCMD} ${service} ${action} ${attempt}"

case "${action}" in

'start')
    ${CMD}
    zstat=$?
    if [ ${zstat} -ne 0 ] ; then
        rc_exit ${service} ${RSF_ABORT}
    fi
    rc_exit ${service} ${RSF_OK}
    ;;

'stop')
    ${CMD}
    zstat=$?
    if [ ${zstat} -ne 0 ] ; then
        rc_exit ${service} ${RSF_ABORT}
    fi
    rc_exit ${service} ${RSF_OK}
    ;;

'check')
    exit ${RSF_CHECK_NORESRC}
    ;;

*)
    rc_exit ${service} ${RSF_WARN} "usage: $0 <start|stop|check>"
    ;;

esac
