changeset 53:18e5ecaa4395 draft

added an export script for dn42
author Nick <nick@somerandomnick.ano>
date Tue, 15 Jun 2010 20:12:25 +0000
parents 8643d1b779de
children 412a2ce1326a
files scripts/export/dn42_registry
diffstat 1 files changed, 20 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/scripts/export/dn42_registry	Tue Jun 15 20:12:25 2010 +0000
@@ -0,0 +1,20 @@
+#!/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