#!/bin/sh
#
# syslog_to_snmp
#
#/etc/rc.d/init.d/portsentry - Start/Stop the portsentry daemon
#

PATH=/usr/local/psionic/portsentry:/bin:/usr/bin:/usr/local/sbin:/usr/local/bin
export PATH

case $1 in 
'start') #If all the config files are there, start it up baby!
        if [ -f /root/bin/syslog_to_snmp.bash ]
	then
		#start the service
		/root/bin/syslog_to_snmp.bash
		 
		#store the pid for portsentry UDP
		echo $! > /etc/syslog_to_snmp.pid
	fi
	;;
'stop')
        if [ -f /etc/syslog_to_snmp.pid ] 
	then
                kill `cat /etc/syslog_to_snmp.pid`
        fi
        ;;
'restart')
	/etc/init.d/syslog_to_snmp stop
	/etc/init.d/syslog_to_snmp start
	;;
*)
        echo "usage: /etc/init.d/syslog_to_snmp {start|stop}"
        ;;
esac
