Lines 22-27
Link Here
|
22 |
# restart! |
22 |
# restart! |
23 |
# Default: "" |
23 |
# Default: "" |
24 |
# |
24 |
# |
|
|
25 |
# to enable multi interface, use: |
26 |
# snort_rules="eth0 eth1" |
27 |
# defaults will follow, snort.conf becomes 'snort_eth0.conf', etc |
25 |
|
28 |
|
26 |
. /etc/rc.subr |
29 |
. /etc/rc.subr |
27 |
|
30 |
|
Lines 42-45
Link Here
|
42 |
[ -n "$snort_conf" ] && snort_flags="$snort_flags -c $snort_conf" |
45 |
[ -n "$snort_conf" ] && snort_flags="$snort_flags -c $snort_conf" |
43 |
[ -n "$snort_expression" ] && snort_flags="$snort_flags $snort_expression" |
46 |
[ -n "$snort_expression" ] && snort_flags="$snort_flags $snort_expression" |
44 |
|
47 |
|
45 |
run_rc_command "$1" |
48 |
if [ -n "$snort_rules" ]; then |
|
|
49 |
_1=$1 |
50 |
if [ $# -gt 1 ]; then shift; snort_rules=$*; fi |
51 |
snort_conf="" |
52 |
snort_flags="" |
53 |
rc=0 |
54 |
for i in ${snort_rules}; do |
55 |
eval _conf=\$snort_${i}_conf |
56 |
eval _flags=\$snort_${i}_flags |
57 |
[ -z "$_flags" ] && _flags="-D -q" |
58 |
eval _intf=\$snort_${i}_interface |
59 |
eval _expr=\$snort_${i}_expression |
60 |
if [ -n "$_intf" ] ;then |
61 |
_conf="$_conf -i $_intf" |
62 |
eval pidfile="/var/run/snort_$_intf.pid" |
63 |
fi |
64 |
command_args="$_flags -c $_conf $_expr" |
65 |
run_rc_command "$_1" |
66 |
if [ $? -ne 0 ]; then rc=1; fi |
67 |
unset _pidcmd _rc_restart_done |
68 |
done |
69 |
exit $rc |
70 |
else |
71 |
run_rc_command "$1" |
72 |
fi |