#!/bin/sh # # Rick van der Zwet # # Update local autoritive DNS server, by transfering zone files from master # using HTTP protocol # # Avoid hammering source, sleep random delay if [ "$1" = "cron" ]; then sleep $(jot -r 1 900) exec 2>/dev/null fi # Fetch source files fetch -T 5 -o /tmp/dns.tar.gz.enc http://wirelessleiden.nl/dns/latest.tar.gz.enc || exit 1 # Check if file has transfered succesfully openssl enc -bf -pass pass:dns -in /tmp/dns.tar.gz.enc -out /dev/null -d 2>/dev/null || exit 1 # Unpack files openssl enc -bf -pass pass:dns -in /tmp/dns.tar.gz.enc -d | tar -C /tmp -xzvf - # Reload autoritive DNS Server nsd-control reload