summaryrefslogtreecommitdiff
path: root/security/snort/files/snort.sh.in
blob: e81c40b90e9789b39145b22e29fda5b408cb4598 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/sh
# $FreeBSD$

# PROVIDE: snort
# REQUIRE: DAEMON
# BEFORE: LOGIN
# KEYWORD: shutdown

# Add the following lines to /etc/rc.conf to enable snort:
# snort_enable (bool):		Set to YES to enable snort
# 				Default: NO
# snort_flags (str):		Extra flags passed to snort
#				Default: -Dq
# snort_interface (str):	Network interface to sniff
#				Default: "" 
# snort_conf (str):		Snort configuration file
#				Default: ${PREFIX}/etc/snort/snort.conf
#

. %%RC_SUBR%%

name="snort"
rcvar=`set_rcvar`

command="%%PREFIX%%/bin/snort"

load_rc_config $name

[ -z "$snort_enable" ]    && snort_enable="NO"
[ -z "$snort_conf" ]      && snort_conf="%%PREFIX%%/etc/snort/snort.conf"
[ -z "$snort_flags" ]     && snort_flags="-Dq"

[ -n "$snort_interface" ] && snort_flags="$snort_flags -i $snort_interface"
[ -n "$snort_conf" ]      && snort_flags="$snort_flags -c $snort_conf"

run_rc_command "$1"