summaryrefslogtreecommitdiff
path: root/scripts/check_db_safety
diff options
context:
space:
mode:
authorNick <nick@somerandomnick.ano>2010-04-19 07:37:46 +0000
committerNick <nick@somerandomnick.ano>2010-04-19 07:37:46 +0000
commitd36677106b32bae92fa7286a917d1b0f7abee5fd (patch)
tree3a51f16339b39830c1185c297c742f0ef873c5cf /scripts/check_db_safety
parentb559df204f4d99b9be8cb86686f844f33c687b19 (diff)
downloadresdb-d36677106b32bae92fa7286a917d1b0f7abee5fd.tar.gz
resdb-d36677106b32bae92fa7286a917d1b0f7abee5fd.zip
added rDNS to tinydns datafile generation
Diffstat (limited to 'scripts/check_db_safety')
-rwxr-xr-xscripts/check_db_safety34
1 files changed, 34 insertions, 0 deletions
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