#!/bin/sh

#
# This file is part of the WatchFrog package, written by
# by %%AUTHOR%% and 
# distributed under the terms of the GNU GPL license.
#
# It has been prepared on %%DATE%% by %%USER%%.
#
# This script start/stop the WatchFrog daemon at boot
# time.
# Usage is
#  cd /sbin/rc0.d ; ln -s ../init.d/WFrog K21WFrog
#  cd /sbin/rc3.d ; ln -s ../init.d/WFrog S56WFrog
#
# i.e. before/after the cron process has started/stopped
# The following line should also be entered in the
# crontab
#  02,17,32,47 * * * * /Ram/bin/frogcron
# or anything similar which would start this every 15 mnts
#

PRGM=%%LOC%%/frogcron
PIDF=%%RUN%%/watchfrog.pid

case $1 in
'start')
	if [ -f $PRGM ]; then
	    echo "Starting $PRGM"
	    $PRGM  >&/dev/null &
	else
	    echo "Could not find $PRGM"
	fi
	;;

'stop')
	echo "Killing WatchFrog"
	if [ -f $PIDF ]; then
	    kill -9 `cat $PIDF`
	    rm -f $PIDF
	fi
	;;

*)
	echo "usage: $0 {start|stop}"
	exit 1
	;;

esac
exit 0