freebsd-ports/dns/nsd/files/nsd.in
Martin Wilke 7aa1baf11b - Add missing openssl dependency [1]
- Fix race when stopping nsd [2]

PR:		ports/130263 [1]
		ports/130294 [2]

Submitted by:	Artis Caune <Artis.Caune@gmail.com> [1] [2]
Approved by:	maintainer
2009-01-16 00:30:07 +00:00

41 lines
548 B
Bash

#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: nsd
# REQUIRE: DAEMON
#
# Add the following line to /etc/rc.conf to enable nsd:
#
# nsd_enable="YES"
#
. %%RC_SUBR%%
name=nsd
rcvar=`set_rcvar`
required_files=%%PREFIX%%/etc/nsd/nsd.conf
command=%%PREFIX%%/sbin/${name}
pidfile=/var/run/${name}.pid
load_rc_config ${name}
nsd_enable=${nsd_enable-"NO"}
stop_cmd="nsd_stop"
nsd_stop()
{
echo "Merging nsd zone transfer changes to zone files."
%%PREFIX%%/sbin/nsdc patch
sleep 5
echo "Stopping nsd."
%%PREFIX%%/sbin/nsdc stop
}
run_rc_command "$1"