diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2007-09-25 16:29:05 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2007-09-25 16:29:05 +0000 |
commit | bec6d7ff062b9760b76d1be796fae3db5f6accf1 (patch) | |
tree | 7bb3f88795d4dfbc0d4df7a758743112fea2b961 /usr | |
parent | a3e9c8d34acac0700a9c9cf9a740e543b5785663 (diff) | |
download | pfsense-bec6d7ff062b9760b76d1be796fae3db5f6accf1.zip pfsense-bec6d7ff062b9760b76d1be796fae3db5f6accf1.tar.gz |
Add update_dns_cache.sh file which monitors dns addresses and looks for changes. A filter reload will be triggered if host ips differ
Diffstat (limited to 'usr')
-rwxr-xr-x | usr/sbin/update_dns_cache.sh | 17 |
1 files changed, 17 insertions, 0 deletions
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 |