aboutsummaryrefslogtreecommitdiff
path: root/security/sguil-sensor/files/sancp_agent.sh.in
blob: 11e692a0420fc878659853acd2c59c9b8313e4d5 (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
#!/bin/sh

# $FreeBSD$

# PROVIDE: sancp_agent
# REQUIRE: DAEMON
# KEYWORD: shutdown

# Add the following line to /etc/rc.conf to enable sancp_agent:
# sancp_agent_enable (bool):     Set to YES to enable sancp_agent
#                                Default: NO
# sancp_agent_conf (str):        Sancp_agent configuration file
#                                Default: %%PREFIX%%/etc/%%SGUILDIR%%/sancp_agent.conf
# sancp_agent_flags (str):       Default: -D
#

. /etc/rc.subr

load_rc_config sancp_agent

#set defaults
sancp_agent_enable=${sancp_agent_enable:-"NO"}
sancp_agent_conf=${sancp_agent_conf:-"%%PREFIX%%/etc/%%SGUILDIR%%/sancp_agent.conf"}
sancp_agent_flags=${sancp_agent_flags:-"-D"}

name="sancp_agent"
rcvar=`set_rcvar`
command="%%PREFIX%%/bin/%%SGUILDIR%%/sancp_agent.tcl"
command_args="-c ${sancp_agent_conf} ${sancp_agent_flags}"
procname="%%PREFIX%%/bin/tclsh8.4"
pidfile="/var/run/${name}.pid"
check_pidfile="${pidfile} ${procname} /bin/sh"

run_rc_command "$1"