From d36677106b32bae92fa7286a917d1b0f7abee5fd Mon Sep 17 00:00:00 2001 From: Nick Date: Mon, 19 Apr 2010 07:37:46 +0000 Subject: added rDNS to tinydns datafile generation --- scripts/check_db_safety | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'scripts/check_db_safety') diff --git a/scripts/check_db_safety b/scripts/check_db_safety index f3f3236..7208ccb 100755 --- a/scripts/check_db_safety +++ b/scripts/check_db_safety @@ -27,3 +27,37 @@ for tld in db/dom/* ; do done done done +if [ "$(ls db/ip/ | tr -d 'A-F0-9\n' | wc -c)" != 0 ]; then + echo "There's a bad first octet. You probably don't want to run any shell scripts." >&2 + exit 1 + for first in db/ip/* ; do + if [ "$(ls $first/ | tr -d 'A-F0-9\n' | wc -c)" != 0 ]; then + echo "There's a bad second octet under $first." >&2 + echo "You probably don't want to run any shell scripts." >&2 + exit 1 + for second in $first/* ; do + if [ "$(ls $second/ | tr -d 'A-F0-9\n' | wc -c)" != 0 ]; then + echo "There's a bad third octet under $second." >&2 + echo "You probably don't want to run any shell scripts." >&2 + exit 1 + fi + for third in $second/* ; do + if [ "$(ls $third/ns/ | tr -d 'a-z0-9\n.-' | wc -c)" != 0 ]; then + ip="$(basename $first).$(basename $second).$(basename $third).0/24" + echo "There's a bad nameserver under $ip." >&2 + echo "You probably don't want to run any shell scripts." >&2 + fi + for ns in $third/ns/* ; do + if [ "$(cat $ns | tr -d '0-9.\n' | wc -c)" != 0 ]; then + ip="$(basename $first).$(basename $second).$(basename $third).0/24" + nsname="$(basename $ns)" + echo "There's a bad nameserver IP under $ip, for" >&2 + echo " $nsname" >&2 + echo "You probably don't want to run any shell scripts." >&2 + fi + done + done + done + fi + done +fi -- cgit v1.2.3