#!/bin/sh
#
# chkconfig: 345 86 24
# description: SOCKS5WatchAG is a monitoring agent that SOCKS5Cop and \
#              SOCKS5Watcher require.  This shell script takes care of \
#              starting and stopping socks5watch.
#

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

# Source networking configuration.
. /etc/sysconfig/network

# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0

[ -f /usr/sbin/socks5watchAG ] || exit 0

# See how we were called.
case "$1" in
  start)
        # Start daemons.
        echo -n "Starting socks5watch: "
        daemon socks5watchAG
        touch /var/lock/subsys/socks5watch
        echo
        ;;
  stop)
        # Stop daemons.
        echo -n "Shutting down socks5watch: "
	stopwatch
        echo "done"
        rm -f /var/lock/subsys/socks5watch
        ;;
  restart|reload)
	$0 stop
	$0 start
	;;
  status)
	status socks5watchAG
	;;
  *)
        echo "Usage: socks5watch {start|stop|status|restart|reload}"
        exit 1
esac

exit 0
