aboutsummaryrefslogtreecommitdiff
path: root/security/sguil-sensor/files/example_agent.in
blob: 79b449745ea32e7fc3613055f7cb16c9d407a3d9 (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: example_agent
# REQUIRE: DAEMON
# KEYWORD: shutdown

# Add the following line to /etc/rc.conf to enable example_agent:
# example_agent_enable (bool):	Set to YES to enable example_agent
# 				Default: NO
# example_agent_conf (str):	Example_agent configuration file
#				Default: %%PREFIX%%/etc/%%SGUILDIR%%/example_agent.conf
# example_agent_flags (str):	Default: -D
#

. /etc/rc.subr

load_rc_config example_agent

#set defaults
example_agent_enable=${example_agent_enable:-"NO"}
example_agent_conf=${example_agent_conf:-"%%PREFIX%%/etc/%%SGUILDIR%%/example_agent.conf"}
example_agent_flags=${example_agent_flags:-"-D"}

name="example_agent"
rcvar=example_agent_enable
command="%%PREFIX%%/bin/%%SGUILDIR%%/example_agent.tcl"
command_args="-c ${example_agent_conf} ${example_agent_flags}"
procname="%%PREFIX%%/bin/tclsh8.4"
pidfile="/var/run/${name}.pid"
check_pidfile="${pidfile} ${procname} /bin/sh"

run_rc_command "$1"