1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-13 07:34:50 +00:00
freebsd-ports/dns/gdnsd2/files/gdnsd.in
Allan Jude 0ec7b47220 gdnsd2: run checkconf before reload/restart
Submitted by:	Andrew Fengler <andrew.fengler@scaleengine.com>
Reviewed by:	matthew
Approved by:	zi (maintainer)
Sponsored by:	ScaleEngine Inc.
Differential Revision:	https://reviews.freebsd.org/D7488
2016-08-26 19:44:57 +00:00

48 lines
869 B
Bash

#!/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"