[Snort-users] beginners question... snort startup script on redhat 7.1

niceshorts at ...131... niceshorts at ...131...
Fri Sep 21 01:05:03 EDT 2001


Steve Wray hat geschrieben:

>Hi,
>new to snort, not new to Linux.
>
>I've scoured the net for a handy dandy
>/etc/init.d/snort script, but so far
>no luck.
>
>It appears not to be in the 1.8.1 tarball,
>nor in the snort-1.7-3.i386.rpm
>(which seems to be the most recent rpm).
>
>Any such handy dandy script exist?

Here's mine.
Suit to taste.

Anthony Kim


#!/bin/sh


DAEMON=/usr/sbin/snort
CONFIG=/etc/snort/snort.conf
IF=eth0

test -f $DAEMON || exit 0
test -f $CONFIG || exit 0

# to find the lib files
cd /etc/snort

case "$1" in
  start)
	echo "Starting ids: snort"
	$DAEMON	-c /etc/snort/snort.conf -A full -UbdDo -i $IF -z all -l /var/log/snort
	echo "."
	;;
  stop)
	echo "Stopping ids: snort"
	kill `cat /var/run/snort_$IF.pid`
       	echo "."
	;;
  restart|force-restart|reload|force-reload)
	$0 stop 
	$0 start
       	;;
  *)
	echo "Usage: /etc/init.d/snort start|stop|restart"
	exit 1
       	;;
esac
exit 0




More information about the Snort-users mailing list