annotate scripts/export/dn42_registry @ 781:f9c3f2b6a6b1 draft

patched peer2anonet bootstrap bug
author d3v11 <d3v11@d3v11.ano>
date Sat, 26 Nov 2011 20:06:20 +0000
parents 4ace60b88ec0
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
53
18e5ecaa4395 added an export script for dn42
Nick <nick@somerandomnick.ano>
parents:
diff changeset
1 #!/bin/sh
18e5ecaa4395 added an export script for dn42
Nick <nick@somerandomnick.ano>
parents:
diff changeset
2 if ! ./scripts/check_db_safety; then
18e5ecaa4395 added an export script for dn42
Nick <nick@somerandomnick.ano>
parents:
diff changeset
3 exit 1
18e5ecaa4395 added an export script for dn42
Nick <nick@somerandomnick.ano>
parents:
diff changeset
4 fi
18e5ecaa4395 added an export script for dn42
Nick <nick@somerandomnick.ano>
parents:
diff changeset
5 mkdir -p export/dn42/data/dns || exit 1
18e5ecaa4395 added an export script for dn42
Nick <nick@somerandomnick.ano>
parents:
diff changeset
6 for d in db/dom/dn42/* ; do
18e5ecaa4395 added an export script for dn42
Nick <nick@somerandomnick.ano>
parents:
diff changeset
7 domain="`basename $d`.dn42"
18e5ecaa4395 added an export script for dn42
Nick <nick@somerandomnick.ano>
parents:
diff changeset
8 owner="`cat $d/owner | tr a-z A-Z`-DN42"
18e5ecaa4395 added an export script for dn42
Nick <nick@somerandomnick.ano>
parents:
diff changeset
9 (
18e5ecaa4395 added an export script for dn42
Nick <nick@somerandomnick.ano>
parents:
diff changeset
10 echo -e "domain:\t\t$domain"
18e5ecaa4395 added an export script for dn42
Nick <nick@somerandomnick.ano>
parents:
diff changeset
11 for ns in $d/ns/* ; do
18e5ecaa4395 added an export script for dn42
Nick <nick@somerandomnick.ano>
parents:
diff changeset
12 nsname="`basename $ns`"
18e5ecaa4395 added an export script for dn42
Nick <nick@somerandomnick.ano>
parents:
diff changeset
13 nsip="`cat $ns`"
18e5ecaa4395 added an export script for dn42
Nick <nick@somerandomnick.ano>
parents:
diff changeset
14 echo -e "nserver:\t$nsname $nsip"
18e5ecaa4395 added an export script for dn42
Nick <nick@somerandomnick.ano>
parents:
diff changeset
15 done
18e5ecaa4395 added an export script for dn42
Nick <nick@somerandomnick.ano>
parents:
diff changeset
16 echo -e "status:\t\tconnect"
18e5ecaa4395 added an export script for dn42
Nick <nick@somerandomnick.ano>
parents:
diff changeset
17 echo -e "admin-c:\t$owner"
68
4ace60b88ec0 export now hijacks tech-c
Nick <nick@somerandomnick.ano>
parents: 66
diff changeset
18 echo -e "tech-c:\t\tRESDB-DN42"
53
18e5ecaa4395 added an export script for dn42
Nick <nick@somerandomnick.ano>
parents:
diff changeset
19 ) > "export/dn42/data/dns/$domain"
18e5ecaa4395 added an export script for dn42
Nick <nick@somerandomnick.ano>
parents:
diff changeset
20 done
66
70a0167e1b20 updated dn42 export to export netblock info
Nick <nick@somerandomnick.ano>
parents: 53
diff changeset
21 mkdir -p export/dn42/data/inetnum || exit 1
70a0167e1b20 updated dn42 export to export netblock info
Nick <nick@somerandomnick.ano>
parents: 53
diff changeset
22 for i3 in db/ip/AC/16/?? ; do
70a0167e1b20 updated dn42 export to export netblock info
Nick <nick@somerandomnick.ano>
parents: 53
diff changeset
23 third="$(basename $i3 | ./scripts/hex2dec)"
70a0167e1b20 updated dn42 export to export netblock info
Nick <nick@somerandomnick.ano>
parents: 53
diff changeset
24 second="$(basename $(dirname $i3) | ./scripts/hex2dec)"
70a0167e1b20 updated dn42 export to export netblock info
Nick <nick@somerandomnick.ano>
parents: 53
diff changeset
25 first="$(basename $(dirname $(dirname $i3)) | ./scripts/hex2dec)"
70a0167e1b20 updated dn42 export to export netblock info
Nick <nick@somerandomnick.ano>
parents: 53
diff changeset
26 ip="$first.$second.$third"
70a0167e1b20 updated dn42 export to export netblock info
Nick <nick@somerandomnick.ano>
parents: 53
diff changeset
27 ownershort="`cat $i3/owner | tr a-z A-Z`"
70a0167e1b20 updated dn42 export to export netblock info
Nick <nick@somerandomnick.ano>
parents: 53
diff changeset
28 owner="$ownershort-DN42"
70a0167e1b20 updated dn42 export to export netblock info
Nick <nick@somerandomnick.ano>
parents: 53
diff changeset
29 (
70a0167e1b20 updated dn42 export to export netblock info
Nick <nick@somerandomnick.ano>
parents: 53
diff changeset
30 echo -e "inetnum:\t$ip.0 - $ip.255"
70a0167e1b20 updated dn42 export to export netblock info
Nick <nick@somerandomnick.ano>
parents: 53
diff changeset
31 for ns in $i3/ns/* ; do
70a0167e1b20 updated dn42 export to export netblock info
Nick <nick@somerandomnick.ano>
parents: 53
diff changeset
32 nsname="`basename $ns`"
70a0167e1b20 updated dn42 export to export netblock info
Nick <nick@somerandomnick.ano>
parents: 53
diff changeset
33 nsip="`cat $ns`"
70a0167e1b20 updated dn42 export to export netblock info
Nick <nick@somerandomnick.ano>
parents: 53
diff changeset
34 echo -e "nserver:\t$nsname $nsip"
70a0167e1b20 updated dn42 export to export netblock info
Nick <nick@somerandomnick.ano>
parents: 53
diff changeset
35 done
70a0167e1b20 updated dn42 export to export netblock info
Nick <nick@somerandomnick.ano>
parents: 53
diff changeset
36 echo -e "netname:\t$ownershort's dn42 network"
70a0167e1b20 updated dn42 export to export netblock info
Nick <nick@somerandomnick.ano>
parents: 53
diff changeset
37 echo -e "country:\tunknown to resdb"
70a0167e1b20 updated dn42 export to export netblock info
Nick <nick@somerandomnick.ano>
parents: 53
diff changeset
38 echo -e "admin-c:\t$owner"
68
4ace60b88ec0 export now hijacks tech-c
Nick <nick@somerandomnick.ano>
parents: 66
diff changeset
39 echo -e "tech-c:\t\tRESDB-DN42"
66
70a0167e1b20 updated dn42 export to export netblock info
Nick <nick@somerandomnick.ano>
parents: 53
diff changeset
40 echo -e "status:\t\tASSIGNED"
70a0167e1b20 updated dn42 export to export netblock info
Nick <nick@somerandomnick.ano>
parents: 53
diff changeset
41 ) > "export/dn42/data/inetnum/$ip.0_24"
70a0167e1b20 updated dn42 export to export netblock info
Nick <nick@somerandomnick.ano>
parents: 53
diff changeset
42 done