comparison scripts/check_db_safety @ 12:41b330b11a33 draft

coded a tinydns datafile generator
author Nick <nick@somerandomnick.ano>
date Mon, 19 Apr 2010 06:10:07 +0000
parents
children 059b5f3d7808
comparison
equal deleted inserted replaced
11:2e7c94478881 12:41b330b11a33
1 #!/bin/sh
2 if [ "$(ls db/dom/ | tr -d 'a-z0-9\n-' | wc -c)" != 0 ]; then
3 echo "There's a bad TLD. You probably don't want to run any shell scripts." >&2
4 exit 1
5 fi
6 for tld in db/dom/* ; do
7 if [ "$(ls $tld/ | tr -d 'a-z0-9\n-' | wc -c)" != 0 ]; then
8 tld="$(basename $tld)"
9 echo "There's a bad domain under $tld." >&2
10 echo "You probably don't want to run any shell scripts." >&2
11 exit 1
12 fi
13 for dom in $tld/* ; do
14 if [ "$(ls $dom/ns/ | tr -d 'a-z0-9\n.-' | wc -c)" != 0 ]; then
15 domain="$(basename $dom).$(basename $tld)"
16 echo "There's a bad nameserver under $domain." >&2
17 echo "You probably don't want to run any shell scripts." >&2
18 fi
19 for ns in $dom/ns/* ; do
20 if [ "$(cat $ns | tr -d '0-9.\n' | wc -c)" != 0 ]; then
21 domain="$(basename $dom).$(basename $tld)"
22 nsname="$(basename $ns)"
23 echo "There's a bad nameserver IP under $domain, for" >&2
24 echo " $nsname" >&2
25 echo "You probably don't want to run any shell scripts." >&2
26 fi
27 done
28 done
29 done