#!/bin/bash
#
#  This script start/stop the hmc Access Manager.
#
### BEGIN INIT INFO
# Provides:       hmcAcmSvc
# Required-Start: $local_fs $network
# Required-Stop:
# Default-Start:  3 5
# Default-Stop:   0 1 2 6
# Description:    Hmc Access Manager service.
### END INIT INFO

#set -x

# Source function library.
. /etc/rc.status
rc_reset

SvcDir=/opt/hsc/sbin
SvcName=runAccessmgr
SvcPidFile=/var/hsc/${SvcName}.pid
CurrDir=`pwd`

case "$1" in
    start)
        ${SvcDir}/${SvcName} &
        rc_status -v 
        ;;
    stop)
        ps -ewwwf | grep ${SvcDir}/${SvcName} |grep -v grep| awk '{print $2}'| xargs kill -15
        rc_status -v
        ;;
    *)
        echo $"Usage: $0 {start|stop}"
      ;;
esac
   
rc_exit

