I got sick of seeing all kinds of ixfr traffic because all the zones were updated each time make was run from update-data.sh, so I modified the script. It will only run when the new data file is different from the old one

-Karl


#!/bin/bash # The FULL path to the index.php file for the VegaDNS server VEGADNS='http://127.0.0.1/vegadns/index.php'

# NOTE: You can get updates from multiple VegaDNS servers if
# desired. Simply separate them by spaces like so:
# VEGADNS='http://server1/vegadns-x.x/index.php http://server2/vegadns-x.x/inde$


# Path to the tinydns directory
TINYDNSDIR=/var/dnscache/tinydns

mv $TINYDNSDIR/root/data $TINYDNSDIR/root/data.old
A=$[0]
for VD in $VEGADNS ; do
    A=$[$A+1]
    wget -q -O "$TINYDNSDIR/root/data.srv-$A" $VD?state=get_data
    cat "$TINYDNSDIR/root/data.srv-$A" >>$TINYDNSDIR/root/data
done

# Don't make if the files havn't changed
OLD=$(sum $TINYDNSDIR/root/data.old)
NEW=$(sum $TINYDNSDIR/root/data)

if [ "$OLD" != "$NEW" ]; then
    (cd $TINYDNSDIR/root ; make -s)
fi



Reply via email to