summaryrefslogtreecommitdiff
path: root/scripts/export/dn42_registry
blob: c5549332f7fbec8a4ddb4503b87578481c89c81a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/sh
if ! ./scripts/check_db_safety; then
 exit 1
fi
mkdir -p export/dn42/data/dns || exit 1
for d in db/dom/dn42/* ; do
 domain="`basename $d`.dn42"
 owner="`cat $d/owner | tr a-z A-Z`-DN42"
 (
  echo -e "domain:\t\t$domain"
  for ns in $d/ns/* ; do
   nsname="`basename $ns`"
   nsip="`cat $ns`"
   echo -e "nserver:\t$nsname $nsip"
  done
  echo -e "status:\t\tconnect"
  echo -e "admin-c:\t$owner"
  echo -e "tech-c:\t\t$owner"
 ) > "export/dn42/data/dns/$domain"
done
mkdir -p export/dn42/data/inetnum || exit 1
for i3 in db/ip/AC/16/?? ; do
 third="$(basename $i3 | ./scripts/hex2dec)"
 second="$(basename $(dirname $i3) | ./scripts/hex2dec)"
 first="$(basename $(dirname $(dirname $i3)) | ./scripts/hex2dec)"
 ip="$first.$second.$third"
 ownershort="`cat $i3/owner | tr a-z A-Z`"
 owner="$ownershort-DN42"
 (
  echo -e "inetnum:\t$ip.0 - $ip.255"
  for ns in $i3/ns/* ; do
   nsname="`basename $ns`"
   nsip="`cat $ns`"
   echo -e "nserver:\t$nsname $nsip"
  done
  echo -e "netname:\t$ownershort's dn42 network"
  echo -e "country:\tunknown to resdb"
  echo -e "admin-c:\t$owner"
  echo -e "tech-c:\t\t$owner"
  echo -e "status:\t\tASSIGNED"
 ) > "export/dn42/data/inetnum/$ip.0_24"
done