summaryrefslogtreecommitdiff
path: root/net-mgmt/macroscope/files/macroscope.in
diff options
context:
space:
mode:
Diffstat (limited to 'net-mgmt/macroscope/files/macroscope.in')
-rw-r--r--net-mgmt/macroscope/files/macroscope.in52
1 files changed, 52 insertions, 0 deletions
diff --git a/net-mgmt/macroscope/files/macroscope.in b/net-mgmt/macroscope/files/macroscope.in
new file mode 100644
index 000000000000..ffb0f9879b16
--- /dev/null
+++ b/net-mgmt/macroscope/files/macroscope.in
@@ -0,0 +1,52 @@
+#!/bin/sh
+#
+# macroscope - start Macroscope daemon
+#
+# $FreeBSD$
+#
+# PROVIDE: macroscope
+# REQUIRE: DAEMON
+# KEYWORD: shutdown
+
+# -----------------------------------------------------------------------------
+# macroscope_enable="NO" # set to YES to enable macroscope
+#
+# # optional:
+# macroscope_flags="" # additional command line arguments
+#
+
+. %%RC_SUBR%%
+
+name="macroscope"
+rcvar=$(set_rcvar)
+
+prefix="%%PREFIX%%"
+
+start_precmd()
+{
+ return 0
+}
+
+stop_postcmd()
+{
+ rm -f "$pidfile" || warn "Could not remove $pidfile."
+}
+
+# pidfile
+eval pidfile=\$${name}_pidfile
+pidfile=${pidfile:-/var/run/${name}.pid}
+echo ${pidfile}
+
+# command and arguments
+command="%%PREFIX%%/sbin/${name}"
+
+# run this first
+start_precmd="start_precmd"
+# and this last
+stop_postcmd="stop_postcmd"
+
+load_rc_config ${name}
+
+command_args="--sniffer --daemon --pid ${pidfile}"
+
+run_rc_command "$1"