#!/bin/bash

case $1 in
start)
	echo Starting aimSniff...
	/usr/local/bin/aimSniff.pl -C=/usr/local/etc/aimSniff.cfg
	;;
stop)
	if [ -r /var/run/aimsniff_parent.pid ]; then
		echo Stopping aimSniff...
		kill -QUIT `cat /var/run/aimsniff_parent.pid`
	fi
	;;
restart)
	$0 stop
	sleep 2
	$0 start
	;;
*)
	echo "Usage: $0 [start|stop|restart]"
	;;
esac
