Mercurial > hg > anonet-resdb
annotate scripts/nameserver_autogen/bind_tld_zonefile @ 10:7e97054a5437 draft
added a script from UFO to autogenerate a bind TLD zonefile
author | Nick <nick@somerandomnick.ano> |
---|---|
date | Sun, 18 Apr 2010 21:29:21 +0000 |
parents | |
children | 2e7c94478881 |
rev | line source |
---|---|
10
7e97054a5437
added a script from UFO to autogenerate a bind TLD zonefile
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
1 <?php |
7e97054a5437
added a script from UFO to autogenerate a bind TLD zonefile
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
2 print('$ttl 600'."\n"); |
7e97054a5437
added a script from UFO to autogenerate a bind TLD zonefile
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
3 chdir('../db/dom/ano'); |
7e97054a5437
added a script from UFO to autogenerate a bind TLD zonefile
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
4 $names = scandir('./'); |
7e97054a5437
added a script from UFO to autogenerate a bind TLD zonefile
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
5 foreach ($names as $name) { |
7e97054a5437
added a script from UFO to autogenerate a bind TLD zonefile
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
6 if (!file_exists($name.'/ns/')) continue; |
7e97054a5437
added a script from UFO to autogenerate a bind TLD zonefile
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
7 $servers = scandir($name.'/ns/'); |
7e97054a5437
added a script from UFO to autogenerate a bind TLD zonefile
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
8 foreach ($servers as $server) { |
7e97054a5437
added a script from UFO to autogenerate a bind TLD zonefile
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
9 if ($server[0] == '.') continue; |
7e97054a5437
added a script from UFO to autogenerate a bind TLD zonefile
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
10 print($name.' IN NS '.$server."\n"); |
7e97054a5437
added a script from UFO to autogenerate a bind TLD zonefile
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
11 $ips = file($name.'/ns/'.$server, FILE_IGNORE_NEW_LINES | |
7e97054a5437
added a script from UFO to autogenerate a bind TLD zonefile
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
12 FILE_SKIP_EMPTY_LINES); |
7e97054a5437
added a script from UFO to autogenerate a bind TLD zonefile
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
13 foreach ($ips as $ip) { |
7e97054a5437
added a script from UFO to autogenerate a bind TLD zonefile
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
14 print($server.' IN A '.$ip."\n"); |
7e97054a5437
added a script from UFO to autogenerate a bind TLD zonefile
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
15 } |
7e97054a5437
added a script from UFO to autogenerate a bind TLD zonefile
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
16 } |
7e97054a5437
added a script from UFO to autogenerate a bind TLD zonefile
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
17 } |
7e97054a5437
added a script from UFO to autogenerate a bind TLD zonefile
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
18 ?> |