#!/sbin/runscript # Copyright 1999-2007 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ # opts="${opts} rebuild reload state update notify configtest" CONTROL="/usr/sbin/nsdc" depend() { need net use logger provide dns } configtest() { ebegin "Checking config" if [ ! -e "/etc/nsd/nsd.conf" ]; then eerror "You need to create an apropriate config file" eerror "in /etc/nsd/ . An example can be found in /etc/nsd/nsd.conf.sample" return 1 fi if ! nsd-checkconf "/etc/nsd/nsd.conf"; then eerror "You have errors in your configfile" return 1 fi eend } start() { configtest || return 1 ebegin "Starting NSD" ${CONTROL} start state eend $? } stop() { ebegin "Stopping NSD" ${CONTROL} stop eend $? } reload() { configtest || return 1 ebegin "Reloading NSD" ${CONTROL} reload eend $? } rebuild() { configtest || return 1 ebegin "Rebuild NSD database" ${CONTROL} rebuild eend $? } state() { ebegin "Check if NSD is running" ${CONTROL} running &> /dev/null eend $? } update() { configtest || return 1 ebegin "Updating NSD seconadary zones" ${CONTROL} update eend $? } notify() { ebegin "Notify slave servers for zones" ${CONTROL} notify eend $? }