#!/bin/sh

# $FreeBSD: head/security/sguil-sensor/files/snort_agent.in 312466 2013-02-18 00:56:47Z miwi $

# PROVIDE: snort_agent
# REQUIRE: DAEMON
# KEYWORD: shutdown

# Add the following line to /etc/rc.conf to enable snort_agent:
# snort_agent_enable (bool):     Set to YES to enable snort_agent
#                                Default: NO
# snort_agent_conf (str):        Snort_agent configuration file
#                                Default: /usr/local/etc/%%SGUILDIR%%/snort_agent.conf
# snort_agent_flags (str):       Default: -D
#

. /etc/rc.subr

name="snort_agent"
rcvar=snort_agent_enable
load_rc_config snort_agent

#set defaults
: ${snort_agent_enable:="NO"}
: ${snort_agent_conf:="/usr/local/etc/%%SGUILDIR%%/snort_agent.conf"}
: ${snort_agent_flags:="-D -c ${snort_agent_conf}"}

command="/usr/local/bin/%%SGUILDIR%%/snort_agent.tcl"
procname="/usr/local/bin/tclsh8.5"
pidfile="/var/run/${name}.pid"

run_rc_command "$1"
