#!/usr/bin/env bash # Joe Gillotti - 3/4/2012 # Checks all zones and returns 1 if any of them are fucked, # zero otherwise. # # Pass -v to see all OK zones. It will output which # are fucked regardless zonepath=/etc/namedb/ ret=0 for i in `awk '/^zone/ {gsub(/"/, "", $2); print $2}' ${zonepath}zones.conf`; do resp=`named-checkzone $i $zonepath$i` if [ "$?" == "1" ]; then echo $i is fucked echo $resp ret=1 else [ "$1" == "-v" ] && echo $i is OK fi done exit $ret