aboutsummaryrefslogtreecommitdiff
path: root/security/sancp/files/sancp.in
blob: 5a50961b1194fc803c2114ada3023c181a20013c (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
37
38
39
40
41
42
43
44
45
#!/bin/sh

# $FreeBSD$
#
# PROVIDE: sancp
# REQUIRE: DAEMON
# BEFORE: LOGIN
# KEYWORD: 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_conf (str):		Sancp configuration file
#				Default: %%PREFIX%%/etc/sancp.conf
# sancp_interface (str):	Default: none - MUST BE SET
#

. /etc/rc.subr

name="sancp"
rcvar=sancp_enable

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

start_precmd=start_precmd

start_precmd()
{
	if [ -z "${sancp_interface}" ]; then
		err 1 "sancp_interface must set."
	fi
}

# set some defaults
load_rc_config $name

: ${sancp_enable="NO"}
: ${sancp_flags="-D"}
: ${sancp_conf="%%PREFIX%%/etc/sancp.conf"}

command_args="-c ${sancp_conf} -i ${sancp_interface}"

run_rc_command "$1"