summaryrefslogtreecommitdiffstats
path: root/usr/sbin/update_dns_cache.sh
blob: ca95e2ca503055e5e8061285a0f59cd05d46bd58 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/sh

mkdir -p cd /var/db/dnscache 

while [ /bin/true ]; do
        cd /var/db/dnscache 
        needsfilterreload=0
        for FILE in *; do
                OLDIP=`cat $FILE`
                NEWIP=`host $FILE | grep -v NXDOMAIN | 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
OpenPOWER on IntegriCloud