User Tools

Site Tools


update_bind_configurations

Update Bind Configurations

#!/bin/bash 
 
# Check SVN repository for ACL update then, fetch and reload named
 
BINDPATH="/etc/bind"
MAILTO="[email protected]"
REPO="http://jason.lithiumfox.com/svn/repos/dns"
 
 
if $(svn st -u $BINDPATH|egrep '(acls.conf?|as[1-9]+.acl?)' > /dev/null 2>&1)
	then
	REVISION=$(svn update $BINDPATH | grep revision | awk '{print $NF}'| tr -d \.) 
	if ERROR=$(/usr/sbin/named-checkconf $BINDPATH/named.conf)
		then
		/etc/init.d/named reload > /dev/null 2>&1
	else
		let "REVISION -= 1" 
		echo $ERROR | mail -s "$HOSTNAME - DNS ACL update failed!" $MAILTO
		svn co -r $REVISION $REPO $BINDPATH > /dev/null 2>&1
	fi
fi
update_bind_configurations.txt · Last modified: 2011/07/15 16:40 by jt