aboutsummaryrefslogtreecommitdiffstats
path: root/security/snort
diff options
context:
space:
mode:
authoredwin <edwin@FreeBSD.org>2003-09-04 21:48:27 +0800
committeredwin <edwin@FreeBSD.org>2003-09-04 21:48:27 +0800
commit50c6b1ba8223f469dcd1921f878b2f602771d244 (patch)
treeca700b41b78ed2857a43ebe93f5f05c42ef063a6 /security/snort
parent99d4c4bb74b6c97ee146a9c9dd4739677849769e (diff)
downloadfreebsd-ports-gnome-50c6b1ba8223f469dcd1921f878b2f602771d244.tar.gz
freebsd-ports-gnome-50c6b1ba8223f469dcd1921f878b2f602771d244.tar.zst
freebsd-ports-gnome-50c6b1ba8223f469dcd1921f878b2f602771d244.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
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