#!/bin/sh # # rebuild name service caches # VER="0.04" # COLUG special # Rev 000531 # DOMAIN="inside.net" CCLASS="172.16.34" MXER="5:stones.wcbe.org" BUILDDIR="/home/COLUG/pubhtml/notes/0005mtg" PROGGIE=`basename $0` # # # cd ${BUILDDIR} # # db.cache is built by cachebuild #[ -e db.cache ] || { # echo db.cache missing | \ # mail -s "$PROGGIE -- DNS rebuild error " root # exit 1 # } # #cp db.cache db.cache.PRIOR # [ -e h2n ] || { echo h2n binary missing | \ mail -s "$PROGGIE -- DNS rebuild error " root exit 1 } # # ... this is wierd in that it uses the local dir hosts file # ./h2n -d $DOMAIN -n $CCLASS -m $MXER -H ./hosts # # disable in this demo # # . /etc/rc.d/init.d/named restart # # [ -e named-bootconf.pl ] || { echo named-bootconf.pl missing | \ mail -s "$PROGGIE -- DNS rebuild error " root exit 1 } # # builds a new named.conf ./named-bootconf.pl < ./named.boot > named.conf # # dangerous with virt domains # # cp named.conf /etc/named.conf # /etc/rc.d/init.d/named stop # Shutting down named: named done sleep 5 # /etc/rc.d/init.d/named start # Starting named: named tail /var/log/messages # -- to confirm restart #