summaryrefslogtreecommitdiff
path: root/security/sancp/files/sancp.sh.in
blob: f8be90c0e112f89200a19e62c0dc08d3e8674386 (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
# 

# PROVIDE: sancp
# REQUIRE: DAEMON
# BEFORE: LOGIN
# KEYWORD: FreeBSD shutdown

# Add the following lines to /etc/rc.conf to enable sancp:
# sancp_enable (bool):	Set to YES to enable sancp
# 				Default: NO
# sancp_flags (str):		Extra flags passed to sancp
#				Default: -D
# sancp_interface (str):        Network interface to sniff
#                               Default: ""
# sancp_conf (str):		Sancp configuration file
#				Default: %%PREFIX%%/etc/sancp.conf
#

. %%RC_SUBR%%

name="sancp"
rcvar=`set_rcvar`

command="%%PREFIX%%/bin/sancp"

load_rc_config $name

[ -z "$sancp_enable" ]    && sancp_enable="NO"
[ -z "$sancp_conf" ]      && sancp_conf="%%PREFIX%%/etc/sancp.conf"
[ -z "$sancp_flags" ]     && sancp_flags="-D"

[ -n "$sancp_interface" ] && sancp_flags="$sancp_flags -i $sancp_interface"
[ -n "$sancp_conf" ]      && sancp_flags="$sancp_flags -c $sancp_conf"

run_rc_command "$1"