12
|
1 #!/bin/sh |
77
|
2 if [ "$(ls db/dom/ | tr -d 'a-z0-9\n-' | wc -c | tr -d ' \t')" != 0 ]; then |
12
|
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 |
78
|
7 if [ "$(ls $tld/ | tr -d 'a-z0-9\n-' | wc -c | tr -d ' \t')" != 0 ]; then |
12
|
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 |
78
|
14 if [ "$(ls $dom/ns/ | tr -d 'a-z0-9\n.-' | wc -c | tr -d ' \t')" != 0 ]; then |
12
|
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 |
532
c9a7817b5f1d
reverting IPv6 changes because too much new complexity and no real benefit
Nick <nick@somerandomnick.ano>
diff
changeset
|
18 exit 1 |
12
|
19 fi |
|
20 for ns in $dom/ns/* ; do |
78
|
21 if [ "$(cat $ns | tr -d '0-9.\n' | wc -c | tr -d ' \t')" != 0 ]; then |
12
|
22 domain="$(basename $dom).$(basename $tld)" |
|
23 nsname="$(basename $ns)" |
|
24 echo "There's a bad nameserver IP under $domain, for" >&2 |
|
25 echo " $nsname" >&2 |
|
26 echo "You probably don't want to run any shell scripts." >&2 |
532
c9a7817b5f1d
reverting IPv6 changes because too much new complexity and no real benefit
Nick <nick@somerandomnick.ano>
diff
changeset
|
27 exit 1 |
12
|
28 fi |
|
29 done |
|
30 done |
|
31 done |
78
|
32 if [ "$(ls db/ip/ | tr -d 'A-F0-9\n' | wc -c | tr -d ' \t')" != 0 ]; then |
13
|
33 echo "There's a bad first octet. You probably don't want to run any shell scripts." >&2 |
|
34 exit 1 |
|
35 for first in db/ip/* ; do |
78
|
36 if [ "$(ls $first/ | tr -d 'A-F0-9\n' | wc -c | tr -d ' \t')" != 0 ]; then |
13
|
37 echo "There's a bad second octet under $first." >&2 |
|
38 echo "You probably don't want to run any shell scripts." >&2 |
|
39 exit 1 |
|
40 for second in $first/* ; do |
78
|
41 if [ "$(ls $second/ | tr -d 'A-F0-9\n' | wc -c | tr -d ' \t')" != 0 ]; then |
13
|
42 echo "There's a bad third octet under $second." >&2 |
|
43 echo "You probably don't want to run any shell scripts." >&2 |
|
44 exit 1 |
|
45 fi |
|
46 for third in $second/* ; do |
78
|
47 if [ "$(ls $third/ns/ | tr -d 'a-z0-9\n.-' | wc -c | tr -d ' \t')" != 0 ]; then |
13
|
48 ip="$(basename $first).$(basename $second).$(basename $third).0/24" |
|
49 echo "There's a bad nameserver under $ip." >&2 |
|
50 echo "You probably don't want to run any shell scripts." >&2 |
532
c9a7817b5f1d
reverting IPv6 changes because too much new complexity and no real benefit
Nick <nick@somerandomnick.ano>
diff
changeset
|
51 exit 1 |
13
|
52 fi |
|
53 for ns in $third/ns/* ; do |
78
|
54 if [ "$(cat $ns | tr -d '0-9.\n' | wc -c | tr -d ' \t')" != 0 ]; then |
13
|
55 ip="$(basename $first).$(basename $second).$(basename $third).0/24" |
|
56 nsname="$(basename $ns)" |
|
57 echo "There's a bad nameserver IP under $ip, for" >&2 |
|
58 echo " $nsname" >&2 |
|
59 echo "You probably don't want to run any shell scripts." >&2 |
532
c9a7817b5f1d
reverting IPv6 changes because too much new complexity and no real benefit
Nick <nick@somerandomnick.ano>
diff
changeset
|
60 exit 1 |
13
|
61 fi |
|
62 done |
|
63 done |
|
64 done |
|
65 fi |
|
66 done |
|
67 fi |