summaryrefslogtreecommitdiffstats
path: root/usr/sbin/update_dns_cache.sh
blob: 49ee231445d91d88618d979214ca39c95409c3dc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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
OpenPOWER on IntegriCloud