summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--security/fwlogwatch/Makefile3
-rw-r--r--security/fwlogwatch/files/fwlogwatch.sh.sample22
-rw-r--r--security/fwlogwatch/pkg-plist1
3 files changed, 26 insertions, 0 deletions
diff --git a/security/fwlogwatch/Makefile b/security/fwlogwatch/Makefile
index d6bb4dee9d94..160aec4a63d3 100644
--- a/security/fwlogwatch/Makefile
+++ b/security/fwlogwatch/Makefile
@@ -29,4 +29,7 @@ post-patch:
s,/usr/local,${PREFIX},g" ${WRKSRC}/main.h
@${PERL} -pi -e "s,/etc,${PREFIX}/etc,g" ${WRKSRC}/${MAN8}
+post-install:
+ @${INSTALL_SCRIPT} ${FILESDIR}/fwlogwatch.sh.sample ${PREFIX}/etc/rc.d
+
.include <bsd.port.mk>
diff --git a/security/fwlogwatch/files/fwlogwatch.sh.sample b/security/fwlogwatch/files/fwlogwatch.sh.sample
new file mode 100644
index 000000000000..b360fe59b717
--- /dev/null
+++ b/security/fwlogwatch/files/fwlogwatch.sh.sample
@@ -0,0 +1,22 @@
+#!/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)
+ if [ -x ${PREFIX}/sbin/fwlogwatch ]; then
+ ${PREFIX}/sbin/fwlogwatch -R && echo -n ' fwlogwatch'
+ fi
+ ;;
+stop)
+ killall fwlogwatch && echo -n ' fwlogwatch'
+ ;;
+*)
+ echo "Usage: `basename $0` {start|stop}" >&2
+ ;;
+esac
+
+exit 0
diff --git a/security/fwlogwatch/pkg-plist b/security/fwlogwatch/pkg-plist
index ad03dee451b1..29c9ff47c9c4 100644
--- a/security/fwlogwatch/pkg-plist
+++ b/security/fwlogwatch/pkg-plist
@@ -1,5 +1,6 @@
etc/fwlogwatch.config
etc/fwlogwatch.template
+etc/rc.d/fwlogwatch.sh.sample
sbin/fwlogwatch
sbin/fwlw_notify
sbin/fwlw_respond