#!/bin/sh
########################################################################
# Begin $rc_base/init.d/
#
# Description : gridctl us3-listen daemons (listen, manage-us3-pipe)
#
# Authors     : Gary Gorbet
#
# Version     : 01.01
#
# Notes       : Goes in /etc/rc.d/init.d
#
########################################################################

. /etc/init.d/functions

case "${1}" in
   start)
      echo -n "Starting us3-listen daemons ..."
      /usr/bin/php ~us3/lims/bin/listen.php &
      echo ""
      sleep 1
      ${0} status
      ;;

   stop)
      echo -n "Stopping us3-listen daemons ..."
      killproc /usr/bin/php
      ;;

   restart)
      ${0} stop
      sleep 1
      ${0} start
      ;;

   status)
      ps -aef|grep -v grep|egrep 'listen.php|us3-pipe'
      ;;

   *)
      echo "Usage: ${0} {start|stop|restart|status}"
      exit 1
      ;;
esac

# End $rc_base/init.d/
