annotate scripts/export/dn42_registry @ 53:18e5ecaa4395 draft

added an export script for dn42
author Nick <nick@somerandomnick.ano>
date Tue, 15 Jun 2010 20:12:25 +0000
parents
children 70a0167e1b20
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"
18e5ecaa4395 added an export script for dn42
Nick <nick@somerandomnick.ano>
parents:
diff changeset
18 echo -e "tech-c:\t\t$owner"
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