#!/sbin/runscript # Copyright 1999-2008 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ CONFIG_FILE="/etc/unbound/unbound.conf" PID_FILE="/var/run/unbound.pid" depend() { need net } start() { ebegin "Starting unbound..." local MESSAGE="`unbound-checkconf ${CONFIG_FILE} 2>&1`" local RESULT=$? if test "${RESULT}" != 0; then eerror "${MESSAGE}" return ${RESULT}; fi touch ${PID_FILE} chown unbound:unbound ${PID_FILE} unbound -c ${CONFIG_FILE} eend ${?} } stop() { ebegin "Stopping unbound..." start-stop-daemon --stop --pidfile=${PID_FILE} eend ${?} }