OpenNSD

My NSD3 Restart Script

I’m starting to use this, along with rsync and incrond, to automatically restart nsd3 on replicated name servers:

#!/bin/sh
# Copyright: Savonix Corporation - http://www.savonix.com/
# Author:    Albert Lash
# License:   MIT
# Date:      20090602

lockfile="/var/lock/rebuild_nsd.lock"

if [ ! -f $lockfile ]
then
    touch $lockfile
    sleep 30
    cd /etc/nsd3
    cat nsd_top.conf nsd_bottom.conf > nsd.conf
    /usr/sbin/nsdc rebuild
    /etc/init.d/nsd3 restart
    rm $lockfile
    exit 0
fi;