Mercurial > hg > anonet-resdb
annotate scripts/nameserver_autogen/bind_tld_zonefile @ 85:f091fb99fcf9 draft
scripts/nameserver_autogen/dnsmasq_tld_conffile modified
author | Antonio Quartulli <ordex@ritirata.org> |
---|---|
date | Tue, 03 Aug 2010 17:28:17 +0200 |
parents | 2e7c94478881 |
children | 1299c56b6d5c 59102e1e06f9 |
rev | line source |
---|---|
11
2e7c94478881
forgot to make some important changes to bind_tld_zonefile generator
Nick <nick@somerandomnick.ano>
parents:
10
diff
changeset
|
1 #!/usr/bin/php |
10
7e97054a5437
added a script from UFO to autogenerate a bind TLD zonefile
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
2 <?php |
7e97054a5437
added a script from UFO to autogenerate a bind TLD zonefile
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
3 print('$ttl 600'."\n"); |
7e97054a5437
added a script from UFO to autogenerate a bind TLD zonefile
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
4 chdir('../db/dom/ano'); |
7e97054a5437
added a script from UFO to autogenerate a bind TLD zonefile
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
5 $names = scandir('./'); |
7e97054a5437
added a script from UFO to autogenerate a bind TLD zonefile
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
6 foreach ($names as $name) { |
7e97054a5437
added a script from UFO to autogenerate a bind TLD zonefile
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
7 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
|
8 $servers = scandir($name.'/ns/'); |
7e97054a5437
added a script from UFO to autogenerate a bind TLD zonefile
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
9 foreach ($servers as $server) { |
7e97054a5437
added a script from UFO to autogenerate a bind TLD zonefile
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
10 if ($server[0] == '.') continue; |
7e97054a5437
added a script from UFO to autogenerate a bind TLD zonefile
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
11 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
|
12 $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
|
13 FILE_SKIP_EMPTY_LINES); |
7e97054a5437
added a script from UFO to autogenerate a bind TLD zonefile
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
14 foreach ($ips as $ip) { |
7e97054a5437
added a script from UFO to autogenerate a bind TLD zonefile
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
15 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
|
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 } |
7e97054a5437
added a script from UFO to autogenerate a bind TLD zonefile
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
19 ?> |