#!/bin/sh
#
# procallator	Script to load procallator at time.
#
# Author	Guilherme Carvalho Chehab <gchehab@abordo.com.br>
#

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

# See how we were called.
case "$1" in
  start)
	if [ -f /usr/local/bin/procallator.pl ]; then
	   action  "Initializing procalator statistics colector " /usr/local/bin/procallator.pl &
	fi

	;;
  stop)
	action "Stoping procallator" kill `ps -ef | grep procallat | grep -v grep | tr -s " " | cut -f 2 -d " "`
	
	;;
  *)
	# do not advertise unreasonable commands that there is no reason
	# to use with this device
	echo "Usage: procallator {start|stop}"
	exit 1
esac

exit 0

