Mercurial > hg > anonet-resdb
annotate scripts/nameserver_autogen/tinydns_tld_datafile @ 79:9a0e9ee425cc draft
bug fixes for tinydns datafile generation (thanks again, Quintum)
author | Nick <nick@somerandomnick.ano> |
---|---|
date | Thu, 22 Jul 2010 01:33:31 +0000 |
parents | 059b5f3d7808 |
children | fa0053d4cb53 |
rev | line source |
---|---|
12
41b330b11a33
coded a tinydns datafile generator
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
1 #!/bin/sh |
41b330b11a33
coded a tinydns datafile generator
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
2 if ! ./scripts/check_db_safety; then |
41b330b11a33
coded a tinydns datafile generator
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
3 exit 1 |
41b330b11a33
coded a tinydns datafile generator
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
4 fi |
41b330b11a33
coded a tinydns datafile generator
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
5 tldsrvrname="$(./scripts/conf_var tinydns__tldsrvrname uz5fvb7zdqyuz4q8ysjdfuf04kzd2lrt0l6fp4uyguxdg5tfut06ck.anons.somerandomnick.ano)" |
41b330b11a33
coded a tinydns datafile generator
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
6 tldsrvrip="$(./scripts/conf_var tinydns__tldsrvrip 1.0.27.37)" |
79
9a0e9ee425cc
bug fixes for tinydns datafile generation (thanks again, Quintum)
Nick <nick@somerandomnick.ano>
parents:
13
diff
changeset
|
7 for tld in db/ip/?? ; do |
9a0e9ee425cc
bug fixes for tinydns datafile generation (thanks again, Quintum)
Nick <nick@somerandomnick.ano>
parents:
13
diff
changeset
|
8 if [ "x$(basename $tld)" != 'x??' ]; then |
9a0e9ee425cc
bug fixes for tinydns datafile generation (thanks again, Quintum)
Nick <nick@somerandomnick.ano>
parents:
13
diff
changeset
|
9 first="$(basename $tld | ./scripts/hex2dec)" |
9a0e9ee425cc
bug fixes for tinydns datafile generation (thanks again, Quintum)
Nick <nick@somerandomnick.ano>
parents:
13
diff
changeset
|
10 tldname="$first.in-addr.arpa" |
9a0e9ee425cc
bug fixes for tinydns datafile generation (thanks again, Quintum)
Nick <nick@somerandomnick.ano>
parents:
13
diff
changeset
|
11 echo "+$tldsrvrname:$tldsrvrip:3600" |
9a0e9ee425cc
bug fixes for tinydns datafile generation (thanks again, Quintum)
Nick <nick@somerandomnick.ano>
parents:
13
diff
changeset
|
12 echo ".$tldname::$tldsrvrname" |
9a0e9ee425cc
bug fixes for tinydns datafile generation (thanks again, Quintum)
Nick <nick@somerandomnick.ano>
parents:
13
diff
changeset
|
13 for ip in $tld/??/?? ; do |
9a0e9ee425cc
bug fixes for tinydns datafile generation (thanks again, Quintum)
Nick <nick@somerandomnick.ano>
parents:
13
diff
changeset
|
14 if [ "x$(basename $ip)" != 'x??' ]; then |
9a0e9ee425cc
bug fixes for tinydns datafile generation (thanks again, Quintum)
Nick <nick@somerandomnick.ano>
parents:
13
diff
changeset
|
15 third="$(basename $ip | ./scripts/hex2dec)" |
9a0e9ee425cc
bug fixes for tinydns datafile generation (thanks again, Quintum)
Nick <nick@somerandomnick.ano>
parents:
13
diff
changeset
|
16 second="$(basename $(dirname $ip) | ./scripts/hex2dec)" |
9a0e9ee425cc
bug fixes for tinydns datafile generation (thanks again, Quintum)
Nick <nick@somerandomnick.ano>
parents:
13
diff
changeset
|
17 first="$(basename $(dirname $(dirname $ip)) | ./scripts/hex2dec)" |
9a0e9ee425cc
bug fixes for tinydns datafile generation (thanks again, Quintum)
Nick <nick@somerandomnick.ano>
parents:
13
diff
changeset
|
18 domain="$third.$second.$first.in-addr.arpa" |
9a0e9ee425cc
bug fixes for tinydns datafile generation (thanks again, Quintum)
Nick <nick@somerandomnick.ano>
parents:
13
diff
changeset
|
19 for ns in $ip/ns/* ; do |
9a0e9ee425cc
bug fixes for tinydns datafile generation (thanks again, Quintum)
Nick <nick@somerandomnick.ano>
parents:
13
diff
changeset
|
20 nsname="$(basename $ns)" |
9a0e9ee425cc
bug fixes for tinydns datafile generation (thanks again, Quintum)
Nick <nick@somerandomnick.ano>
parents:
13
diff
changeset
|
21 if [ "x$nsname" != 'x*' ]; then |
9a0e9ee425cc
bug fixes for tinydns datafile generation (thanks again, Quintum)
Nick <nick@somerandomnick.ano>
parents:
13
diff
changeset
|
22 nsip="$(cat $ns)" |
9a0e9ee425cc
bug fixes for tinydns datafile generation (thanks again, Quintum)
Nick <nick@somerandomnick.ano>
parents:
13
diff
changeset
|
23 echo "&$domain:$nsip:$nsname" |
9a0e9ee425cc
bug fixes for tinydns datafile generation (thanks again, Quintum)
Nick <nick@somerandomnick.ano>
parents:
13
diff
changeset
|
24 fi |
9a0e9ee425cc
bug fixes for tinydns datafile generation (thanks again, Quintum)
Nick <nick@somerandomnick.ano>
parents:
13
diff
changeset
|
25 done |
9a0e9ee425cc
bug fixes for tinydns datafile generation (thanks again, Quintum)
Nick <nick@somerandomnick.ano>
parents:
13
diff
changeset
|
26 fi |
13
059b5f3d7808
added rDNS to tinydns datafile generation
Nick <nick@somerandomnick.ano>
parents:
12
diff
changeset
|
27 done |
79
9a0e9ee425cc
bug fixes for tinydns datafile generation (thanks again, Quintum)
Nick <nick@somerandomnick.ano>
parents:
13
diff
changeset
|
28 fi |
13
059b5f3d7808
added rDNS to tinydns datafile generation
Nick <nick@somerandomnick.ano>
parents:
12
diff
changeset
|
29 done |
12
41b330b11a33
coded a tinydns datafile generator
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
30 for tld in db/dom/* ; do |
41b330b11a33
coded a tinydns datafile generator
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
31 tldname="$(basename $tld)" |
41b330b11a33
coded a tinydns datafile generator
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
32 echo "+$tldsrvrname:$tldsrvrip:3600" |
41b330b11a33
coded a tinydns datafile generator
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
33 echo ".$tldname::$tldsrvrname" |
41b330b11a33
coded a tinydns datafile generator
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
34 for zone in $tld/* ; do |
41b330b11a33
coded a tinydns datafile generator
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
35 for ns in $zone/ns/* ; do |
41b330b11a33
coded a tinydns datafile generator
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
36 domain="$(basename $zone).$(basename $tld)" |
41b330b11a33
coded a tinydns datafile generator
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
37 nsip="$(cat $ns)" |
41b330b11a33
coded a tinydns datafile generator
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
38 nsname="$(basename $ns)" |
41b330b11a33
coded a tinydns datafile generator
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
39 echo "&$domain:$nsip:$nsname" |
41b330b11a33
coded a tinydns datafile generator
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
40 done |
41b330b11a33
coded a tinydns datafile generator
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
41 done |
41b330b11a33
coded a tinydns datafile generator
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
42 done |