#!/sbin/openrc-run
# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

extra_started_commands="ping"

depend() {
	need net
}

start() {
	ebegin "Starting PowerDNS Recursor"
	/usr/sbin/pdns_recursor --daemon=yes >/dev/null 2>&1
	eend $?
}

stop() {
	ebegin "Stopping PowerDNS Recursor"
	/usr/bin/rec_control quit >/dev/null 2>&1
	eend $?
}

ping() {
	ebegin "Pinging PowerDNS Recursor"
	/usr/bin/rec_control ping >/dev/null 2>&1
	eend $?
}
