From bec6d7ff062b9760b76d1be796fae3db5f6accf1 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Tue, 25 Sep 2007 16:29:05 +0000 Subject: Add update_dns_cache.sh file which monitors dns addresses and looks for changes. A filter reload will be triggered if host ips differ --- usr/sbin/update_dns_cache.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 usr/sbin/update_dns_cache.sh (limited to 'usr/sbin') diff --git a/usr/sbin/update_dns_cache.sh b/usr/sbin/update_dns_cache.sh new file mode 100755 index 0000000..49ee231 --- /dev/null +++ b/usr/sbin/update_dns_cache.sh @@ -0,0 +1,17 @@ +#!/bin/sh + +while [ /bin/true ]; do + cd /var/db/dnscache + needsfilterreload=0 + for FILE in *; do + OLDIP=`cat $FILE` + NEWIP=`host $FILE | awk '{ print $4 }'` + if [ "$OLDIP" != "$NEWIP" ]; then + needsfilterreload=1 + fi + done + if [ "$needsfilterreload" -gt 0 ]; then + /etc/rc.filter_configure_sync + fi + sleep 480 +done -- cgit v1.1