summaryrefslogtreecommitdiff
path: root/net-mgmt/darkstat/files
diff options
context:
space:
mode:
authorMartin Wilke <miwi@FreeBSD.org>2007-10-05 21:53:35 +0000
committerMartin Wilke <miwi@FreeBSD.org>2007-10-05 21:53:35 +0000
commite6e13e90f00228e43479bb3040e214d5ab25ac25 (patch)
treefec0062f494055b2a6b3124791eeb4659030ca50 /net-mgmt/darkstat/files
parent- Update to 0.7.4 (diff)
- Update to 3.0.707
PR: 116869 Submitted by: Emil Mikulic <emil@cs.rmit.edu.au> (maintainer)
Notes
Notes: svn path=/head/; revision=200940
Diffstat (limited to 'net-mgmt/darkstat/files')
-rw-r--r--net-mgmt/darkstat/files/darkstat.in59
1 files changed, 59 insertions, 0 deletions
diff --git a/net-mgmt/darkstat/files/darkstat.in b/net-mgmt/darkstat/files/darkstat.in
new file mode 100644
index 000000000000..fd87a6ffe09a
--- /dev/null
+++ b/net-mgmt/darkstat/files/darkstat.in
@@ -0,0 +1,59 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+# PROVIDE: darkstat
+# REQUIRE: LOGIN
+# KEYWORD: shutdown
+
+# Add the following lines to /etc/rc.conf to enable `darkstat':
+#
+# darkstat_enable="YES"
+# darkstat_interface="fxp0" # change to suit your configuration
+#
+# Optional configuration flags:
+#
+# darkstat_dir="/var/run/darkstat"
+# darkstat_pidname="darkstat.pid"
+# darkstat_dropuser="nobody"
+# darkstat_flags=""
+# - examples: [ --no-promisc ] [ --no-dns ] [ -p port ]
+# [ -b bindaddr ] [ -f filter ] [ -l network/netmask ]
+# [ --daylog filename ] [ --import filename ] [ --export filename ]
+#
+# - DON'T pass -i, --chroot, --pidfile, or --user here
+#
+# Please refer to the darkstat(1) manual page for full documentation.
+
+. %%RC_SUBR%%
+
+name=darkstat
+rcvar=`set_rcvar`
+
+command=%%PREFIX%%/sbin/$name
+start_precmd=darkstat_prestart
+
+load_rc_config $name
+: ${darkstat_enable="NO"}
+: ${darkstat_dir="/var/run/darkstat"}
+: ${darkstat_pidname="darkstat.pid"}
+: ${darkstat_dropuser="nobody"}
+: ${darkstat_flags=""}
+pidfile="${darkstat_dir}/${darkstat_pidname}"
+
+darkstat_prestart()
+{
+ if [ "x${darkstat_interface}" = "x" ]; then
+ err 1 "You must define \$darkstat_interface."
+ fi
+ mkdir -p ${darkstat_dir}
+ chown ${darkstat_dropuser} ${darkstat_dir}
+ chmod u+wx ${darkstat_dir}
+}
+
+darkstat_flags="-i ${darkstat_interface} --chroot ${darkstat_dir} \
+--pidfile ${darkstat_pidname} --user ${darkstat_dropuser} \
+${darkstat_flags}"
+
+run_rc_command "$1"