Mercurial > hg > anonet-resdb
comparison scripts/check_db_safety @ 13:059b5f3d7808 draft
added rDNS to tinydns datafile generation
author | Nick <nick@somerandomnick.ano> |
---|---|
date | Mon, 19 Apr 2010 07:37:46 +0000 |
parents | 41b330b11a33 |
children | 6c1d4e261fdf |
comparison
equal
deleted
inserted
replaced
12:41b330b11a33 | 13:059b5f3d7808 |
---|---|
25 echo "You probably don't want to run any shell scripts." >&2 | 25 echo "You probably don't want to run any shell scripts." >&2 |
26 fi | 26 fi |
27 done | 27 done |
28 done | 28 done |
29 done | 29 done |
30 if [ "$(ls db/ip/ | tr -d 'A-F0-9\n' | wc -c)" != 0 ]; then | |
31 echo "There's a bad first octet. You probably don't want to run any shell scripts." >&2 | |
32 exit 1 | |
33 for first in db/ip/* ; do | |
34 if [ "$(ls $first/ | tr -d 'A-F0-9\n' | wc -c)" != 0 ]; then | |
35 echo "There's a bad second octet under $first." >&2 | |
36 echo "You probably don't want to run any shell scripts." >&2 | |
37 exit 1 | |
38 for second in $first/* ; do | |
39 if [ "$(ls $second/ | tr -d 'A-F0-9\n' | wc -c)" != 0 ]; then | |
40 echo "There's a bad third octet under $second." >&2 | |
41 echo "You probably don't want to run any shell scripts." >&2 | |
42 exit 1 | |
43 fi | |
44 for third in $second/* ; do | |
45 if [ "$(ls $third/ns/ | tr -d 'a-z0-9\n.-' | wc -c)" != 0 ]; then | |
46 ip="$(basename $first).$(basename $second).$(basename $third).0/24" | |
47 echo "There's a bad nameserver under $ip." >&2 | |
48 echo "You probably don't want to run any shell scripts." >&2 | |
49 fi | |
50 for ns in $third/ns/* ; do | |
51 if [ "$(cat $ns | tr -d '0-9.\n' | wc -c)" != 0 ]; then | |
52 ip="$(basename $first).$(basename $second).$(basename $third).0/24" | |
53 nsname="$(basename $ns)" | |
54 echo "There's a bad nameserver IP under $ip, for" >&2 | |
55 echo " $nsname" >&2 | |
56 echo "You probably don't want to run any shell scripts." >&2 | |
57 fi | |
58 done | |
59 done | |
60 done | |
61 fi | |
62 done | |
63 fi |