Mercurial > hg > anonet-resdb
annotate scripts/nameserver_autogen/tinydns_tld_datafile @ 66:70a0167e1b20 draft
updated dn42 export to export netblock info
author | Nick <nick@somerandomnick.ano> |
---|---|
date | Mon, 21 Jun 2010 19:01:09 +0000 |
parents | 059b5f3d7808 |
children | 9a0e9ee425cc |
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)" |
13
059b5f3d7808
added rDNS to tinydns datafile generation
Nick <nick@somerandomnick.ano>
parents:
12
diff
changeset
|
7 for tld in db/ip/* ; do |
059b5f3d7808
added rDNS to tinydns datafile generation
Nick <nick@somerandomnick.ano>
parents:
12
diff
changeset
|
8 first="$(basename $tld | ./scripts/hex2dec)" |
059b5f3d7808
added rDNS to tinydns datafile generation
Nick <nick@somerandomnick.ano>
parents:
12
diff
changeset
|
9 tldname="$first.in-addr.arpa" |
059b5f3d7808
added rDNS to tinydns datafile generation
Nick <nick@somerandomnick.ano>
parents:
12
diff
changeset
|
10 echo "+$tldsrvrname:$tldsrvrip:3600" |
059b5f3d7808
added rDNS to tinydns datafile generation
Nick <nick@somerandomnick.ano>
parents:
12
diff
changeset
|
11 echo ".$tldname::$tldsrvrname" |
059b5f3d7808
added rDNS to tinydns datafile generation
Nick <nick@somerandomnick.ano>
parents:
12
diff
changeset
|
12 for ip in $tld/*/* ; do |
059b5f3d7808
added rDNS to tinydns datafile generation
Nick <nick@somerandomnick.ano>
parents:
12
diff
changeset
|
13 third="$(basename $ip | ./scripts/hex2dec)" |
059b5f3d7808
added rDNS to tinydns datafile generation
Nick <nick@somerandomnick.ano>
parents:
12
diff
changeset
|
14 second="$(basename $(dirname $ip) | ./scripts/hex2dec)" |
059b5f3d7808
added rDNS to tinydns datafile generation
Nick <nick@somerandomnick.ano>
parents:
12
diff
changeset
|
15 first="$(basename $(dirname $(dirname $ip)) | ./scripts/hex2dec)" |
059b5f3d7808
added rDNS to tinydns datafile generation
Nick <nick@somerandomnick.ano>
parents:
12
diff
changeset
|
16 domain="$third.$second.$first.in-addr.arpa" |
059b5f3d7808
added rDNS to tinydns datafile generation
Nick <nick@somerandomnick.ano>
parents:
12
diff
changeset
|
17 for ns in $ip/ns/* ; do |
059b5f3d7808
added rDNS to tinydns datafile generation
Nick <nick@somerandomnick.ano>
parents:
12
diff
changeset
|
18 nsip="$(cat $ns)" |
059b5f3d7808
added rDNS to tinydns datafile generation
Nick <nick@somerandomnick.ano>
parents:
12
diff
changeset
|
19 nsname="$(basename $ns)" |
059b5f3d7808
added rDNS to tinydns datafile generation
Nick <nick@somerandomnick.ano>
parents:
12
diff
changeset
|
20 echo "&$domain:$nsip:$nsname" |
059b5f3d7808
added rDNS to tinydns datafile generation
Nick <nick@somerandomnick.ano>
parents:
12
diff
changeset
|
21 done |
059b5f3d7808
added rDNS to tinydns datafile generation
Nick <nick@somerandomnick.ano>
parents:
12
diff
changeset
|
22 done |
059b5f3d7808
added rDNS to tinydns datafile generation
Nick <nick@somerandomnick.ano>
parents:
12
diff
changeset
|
23 done |
12
41b330b11a33
coded a tinydns datafile generator
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
24 for tld in db/dom/* ; do |
41b330b11a33
coded a tinydns datafile generator
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
25 tldname="$(basename $tld)" |
41b330b11a33
coded a tinydns datafile generator
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
26 echo "+$tldsrvrname:$tldsrvrip:3600" |
41b330b11a33
coded a tinydns datafile generator
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
27 echo ".$tldname::$tldsrvrname" |
41b330b11a33
coded a tinydns datafile generator
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
28 for zone in $tld/* ; do |
41b330b11a33
coded a tinydns datafile generator
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
29 for ns in $zone/ns/* ; do |
41b330b11a33
coded a tinydns datafile generator
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
30 domain="$(basename $zone).$(basename $tld)" |
41b330b11a33
coded a tinydns datafile generator
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
31 nsip="$(cat $ns)" |
41b330b11a33
coded a tinydns datafile generator
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
32 nsname="$(basename $ns)" |
41b330b11a33
coded a tinydns datafile generator
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
33 echo "&$domain:$nsip:$nsname" |
41b330b11a33
coded a tinydns datafile generator
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
34 done |
41b330b11a33
coded a tinydns datafile generator
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
35 done |
41b330b11a33
coded a tinydns datafile generator
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
36 done |