summaryrefslogtreecommitdiff
path: root/dns/gdnsd2/files/gdnsd.in
blob: f32daf9e0c8a7f913ab79a388b4e402b3a6f1948 (plain)
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
46
47
#!/bin/sh

# $FreeBSD$
#
# PROVIDE: gdnsd
# REQUIRE: DAEMON
# REQUIRE: LOGIN
# KEYWORD: FreeBSD shutdown
#
# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
# to enable this service:
#
# gdnsd_enable (bool):	Set to NO by default.
#				Set it to YES to enable gdnsd.
# gdnsd_flags (str):		Set to "" by default
#				Extra command line argument flags

. /etc/rc.subr

name="gdnsd"
rcvar=gdnsd_enable

# set defaults
load_rc_config $name
: ${gdnsd_enable:="NO"}
: ${gdnsd_flags:=""}

command="%%PREFIX%%/sbin/gdnsd"
command_args="start"
procname=${command}
restart_precmd="gdnsd_checkconf"
reload_cmd="gdnsd_reload"
reload_precmd="gdnsd_checkconf"
configtest_cmd="gdnsd_checkconf"
extra_commands="reload configtest"
gdnsd_reload()
{
  ${command} ${gdnsd_flags} reload-zones
}

gdnsd_checkconf()
{
  ${command} ${gdnsd_flags} checkconf
}

run_rc_command "$1"