#!/bin/sh exec 2>&1 ROOT_ZONE_FILE=root.zone ROOT_TMP_FILE=${ROOT_ZONE_FILE}.tmp ROOT_GZ_FILE=${ROOT_ZONE_FILE}.gz ROOT_SIG_FILE=${ROOT_GZ_FILE}.sig cd /etc/dnsroot/root wget -N https://www.internic.net/domain/${ROOT_SIG_FILE} 2>&1 | grep -E 'not (modified|retrieving)' # nothing to fetch if [ "X0" = "X$?" ]; then exit 1 fi wget -qN https://www.internic.net/domain/${ROOT_GZ_FILE} && \ gpg2 --status-fd 1 --verify ${ROOT_SIG_FILE} && \ gzip -d -c < ${ROOT_GZ_FILE} > ${ROOT_TMP_FILE} && \ mv -f ${ROOT_TMP_FILE} ${ROOT_ZONE_FILE} && \ ./dnsroot < ${ROOT_ZONE_FILE} > ./data.tmp && \ mv -f ./data.tmp ./data && \ make && exit 0 || exit 100