summaryrefslogtreecommitdiff
path: root/security/sguil-sensor/files/pcap_agent.in
diff options
context:
space:
mode:
Diffstat (limited to 'security/sguil-sensor/files/pcap_agent.in')
-rw-r--r--security/sguil-sensor/files/pcap_agent.in34
1 files changed, 34 insertions, 0 deletions
diff --git a/security/sguil-sensor/files/pcap_agent.in b/security/sguil-sensor/files/pcap_agent.in
new file mode 100644
index 000000000000..264c2ab4b865
--- /dev/null
+++ b/security/sguil-sensor/files/pcap_agent.in
@@ -0,0 +1,34 @@
+#!/bin/sh
+
+# $FreeBSD$
+
+# PROVIDE: pcap_agent
+# REQUIRE: DAEMON
+# KEYWORD: shutdown
+
+# Add the following line to /etc/rc.conf to enable pcap_agent:
+# pcap_agent_enable (bool): Set to YES to enable pcap_agent
+# Default: NO
+# pcap_agent_conf (str): Pcap_agent configuration file
+# Default: %%PREFIX%%/etc/%%SGUILDIR%%/pcap_agent.conf
+# pcap_agent_flags (str): Default: -D
+#
+
+. /etc/rc.subr
+
+load_rc_config pcap_agent
+
+#set defaults
+pcap_agent_enable=${pcap_agent_enable:-"NO"}
+pcap_agent_conf=${pcap_agent_conf:-"%%PREFIX%%/etc/%%SGUILDIR%%/pcap_agent.conf"}
+pcap_agent_flags=${pcap_agent_flags:-"-D"}
+
+name="pcap_agent"
+rcvar=pcap_agent_enable
+command="%%PREFIX%%/bin/%%SGUILDIR%%/pcap_agent.tcl"
+command_args="-c ${pcap_agent_conf} ${pcap_agent_flags}"
+procname="%%PREFIX%%/bin/tclsh8.4"
+pidfile="/var/run/${name}.pid"
+check_pidfile="${pidfile} ${procname} /bin/sh"
+
+run_rc_command "$1"