#!/bin/sh
#
# chkconfig: 345 80 20
# description: Start and stop remote system info polling tool

# Source function library
. /etc/init.d/functions

# Source configuration
. /etc/sysconfig/network

DAEMON=rgpsp_linux

start () {
	# start daemon
	echo -n "Starting $DAEMON: "
	daemon $DAEMON
	RETVAL=$?
	echo
	[ $RETVAL = 0 ] && touch	/var/lock/subsys/$DAEMON
	return $RETVAL
}

stop () {
	# stop daemon
	echo -n "Stopping $DAEMON: "
	killproc $DAEMON 
	RETVAL=?$
	echo
	[ $RETVAL = 0 ] && rm /var/lock/subsys/$DAEMON
}

restart() {
	stop
	start
}

case $1 in
  start)
  	start  
	;;
  stop)
  	stop
	;;
  restart)
	restart
	;;
  condrestart)
	[ -f /var/lock/subsys/$DAEMON ] && restart || : 
	;;
  status)
    status rgpsp_linux
    RETVAL=$?
  ;;
  *)
    echo "Usage: $0 {start|stop|status|restart|condrestart}"
    exit 1

esac

exit $RETVAL

