#!/bin/sh # /etc/cron.monthly/bind # # Copyright 2001,2004 Mark Ferlatte # Available under the terms of the GNU General Public License version 2.0 PATH=/sbin:/bin:/usr/sbin:/usr/bin me=$(basename $0) # Get safe temporary file tmpfile=$(mktemp /tmp/$me.XXXXXX) if [ $? -ne 0 ]; then echo "$me: Can't create temp file. Exiting." exit 1 fi dig @localhost . ns > $tmpfile if grep '^A.ROOT-SERVERS.NET' $tmpfile > /dev/null; then cp /etc/bind/db.root /etc/bind/db.root~ mv $tmpfile /etc/bind/db.root chmod 0644 /etc/bind/db.root else rm -f $tmpfile fi