aboutsummaryrefslogtreecommitdiff
path: root/dns/inadyn/files/inadyn.in
blob: 2c1a778157247b5357be43d885cd8050923c7e51 (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

# PROVIDE: inadyn
# REQUIRE: NETWORKING
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
# to enable this service:
#
# inadyn_enable (bool):		Set it to "YES" to enable inadyn
#				Default is "NO"
# inadyn_config (str):		Set full path to configuration file.
#				Default is "%%PREFIX%%/etc/inadyn.conf"
# inadyn_pidfile (str):		Set full path to pid file.
#				Default is "/var/run/inadyn/inadyn.pid"
#

. /etc/rc.subr

name="inadyn"
rcvar=inadyn_enable

start_precmd="inadyn_checkconfig"
restart_precmd="inadyn_checkconfig"
configtest_precmd="inadyn_checkconfig"
extra_commands="configtest"

load_rc_config $name

: ${inadyn_enable:="NO"}
: ${inadyn_config:="%%PREFIX%%/etc/inadyn.conf"}
: ${inadyn_pidfile:="/var/run/inadyn/inadyn.pid"}

command=%%PREFIX%%/sbin/inadyn
command_args="-p inadyn:inadyn -f ${inadyn_config} -P ${inadyn_pidfile}"
pidfile=${inadyn_pidfile}
required_files=${inadyn_config}

inadyn_checkconfig()
{
	echo "Performing sanity check on ${name} configuration:"
	eval ${command} ${command_args} --check-config
}

run_rc_command "$1"