aboutsummaryrefslogtreecommitdiff
path: root/security/snort
diff options
context:
space:
mode:
authorEdwin Groothuis <edwin@FreeBSD.org>2003-09-04 13:48:27 +0000
committerEdwin Groothuis <edwin@FreeBSD.org>2003-09-04 13:48:27 +0000
commit81ff94180c614317da686d4911926d7aa69076f7 (patch)
treecf1439f2f4400bf1d9980b7e90e3545d5ef5af27 /security/snort
parentccb26524fc6531cfabec267f86f9b1d758f028b3 (diff)
downloadports-81ff94180c614317da686d4911926d7aa69076f7.tar.gz
ports-81ff94180c614317da686d4911926d7aa69076f7.zip
irc.d script for security/snort
This is a sample script for ${PREFIX}/etc/rc.d that will wake snort up on boot, and take it down on shutdown. Nothing fancy here. This is needed, because I'm planning on teaching ACID many new things, and ACID expects snort to help itself. There is only one thing that requires thinking here: This should run only after {MySQL|PostgreSQL} server is up, as snort might want to report to the local server. PR: ports/49047 Submitted by: Yonatan@xpert.com <Yonatan@xpert.com> Approved by: maintainer timeout
Notes
Notes: svn path=/head/; revision=88534
Diffstat (limited to 'security/snort')
-rw-r--r--security/snort/Makefile2
-rw-r--r--security/snort/files/snort.sh.sample21
-rw-r--r--security/snort/pkg-plist1
3 files changed, 24 insertions, 0 deletions
diff --git a/security/snort/Makefile b/security/snort/Makefile
index 607aec4a51f4..1cddf5da1d7e 100644
--- a/security/snort/Makefile
+++ b/security/snort/Makefile
@@ -80,6 +80,8 @@ post-install:
${CP} ${DATADIR}/reference.config-sample \
${DATADIR}/reference.config; \
fi; \
+ ${INSTALL_DATA} ${FILESDIR}/snort.sh.sample \
+ ${PREFIX}/etc/rc.d/snort.sh.sample; \
${INSTALL_DATA} ${WRKSRC}/etc/snort.conf \
${PREFIX}/etc/snort.conf-sample; \
if [ ! -f ${PREFIX}/etc/snort.conf ]; then \
diff --git a/security/snort/files/snort.sh.sample b/security/snort/files/snort.sh.sample
new file mode 100644
index 000000000000..b1bb94874977
--- /dev/null
+++ b/security/snort/files/snort.sh.sample
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/$(basename $0)\$"); then
+ echo "$0: Cannot determine the PREFIX" >&2
+ exit 1
+fi
+
+case "$1" in
+start)
+ ${PREFIX}/bin/snort -Dqc ${PREFIX}/etc/snort.conf > /dev/null && echo -n " snort"
+ ;;
+stop)
+ kill `cat /var/run/snort_*.pid`
+ ;;
+restart)
+ killall -1 `cat /var/run/snort_*.pid`
+ ;;
+*)
+ echo "Usage: snort.sh [start|stop|restart]"
+ ;;
+esac
diff --git a/security/snort/pkg-plist b/security/snort/pkg-plist
index fc0fd72a17e6..ad6472b370c2 100644
--- a/security/snort/pkg-plist
+++ b/security/snort/pkg-plist
@@ -1,6 +1,7 @@
bin/snort
@unexec if [ -f %D/etc/snort.conf ] && cmp -s %D/etc/snort.conf %D/etc/snort.conf-sample; then rm -f %D/etc/snort.conf; fi
etc/snort.conf-sample
+etc/rc.d/snort.sh.sample
@exec [ -f %B/snort.conf ] || cp %B/%f %B/snort.conf
%%PORTDOCS%%share/doc/snort/AUTHORS
%%PORTDOCS%%share/doc/snort/NEWS