repo: resdb
action: commit
revision: 
path_from: 
revision_from: d36677106b32bae92fa7286a917d1b0f7abee5fd:
path_to: 
revision_to: 
git.thebackupbox.net
resdb
git clone git://git.thebackupbox.net/resdb
commit d36677106b32bae92fa7286a917d1b0f7abee5fd
Author: Nick 
Date:   Mon Apr 19 07:37:46 2010 +0000

    added rDNS to tinydns datafile generation

diff --git a/db/ip/01/03/03/cidr b/db/ip/01/03/03/cidr
new file mode 100644
index 0000000000000000000000000000000000000000..07cc7d0c72a6bee947ffe1720be046cdf40d2d29
--- /dev/null
+++ b/db/ip/01/03/03/cidr
@@ -0,0 +1 @@
+1.3.3.0/24
diff --git a/db/ip/01/03/03/ns/ns1.ucis.ano b/db/ip/01/03/03/ns/ns1.ucis.ano
new file mode 100644
index 0000000000000000000000000000000000000000..4e697a79fc4ed913c7b34a76ecf40df4d760e467
--- /dev/null
+++ b/db/ip/01/03/03/ns/ns1.ucis.ano
@@ -0,0 +1 @@
+1.3.3.1
diff --git a/db/ip/01/03/03/owner b/db/ip/01/03/03/owner
new file mode 100644
index 0000000000000000000000000000000000000000..6273a2088fe8a4d08e761a562587b96a34b94652
--- /dev/null
+++ b/db/ip/01/03/03/owner
@@ -0,0 +1 @@
+UFO
diff --git a/scripts/check_db_safety b/scripts/check_db_safety
index f3f323690ca2c76d82c85ff08fdc4ab06f62d6d7..
index ..7208ccbc4b8c911fdbdd1232e0005c08496259a2 100755
--- a/scripts/check_db_safety
+++ b/scripts/check_db_safety
@@ -27,3 +27,37 @@ for tld in db/dom/* ; do
   done
  done
 done
+if [ "$(ls db/ip/ | tr -d 'A-F0-9\n' | wc -c)" != 0 ]; then
+ echo "There's a bad first octet.  You probably don't want to run any shell scripts." >&2
+ exit 1
+ for first in db/ip/* ; do
+  if [ "$(ls $first/ | tr -d 'A-F0-9\n' | wc -c)" != 0 ]; then
+   echo "There's a bad second octet under $first." >&2
+   echo "You probably don't want to run any shell scripts." >&2
+   exit 1
+   for second in $first/* ; do
+    if [ "$(ls $second/ | tr -d 'A-F0-9\n' | wc -c)" != 0 ]; then
+     echo "There's a bad third octet under $second." >&2
+     echo "You probably don't want to run any shell scripts." >&2
+     exit 1
+    fi
+    for third in $second/* ; do
+     if [ "$(ls $third/ns/ | tr -d 'a-z0-9\n.-' | wc -c)" != 0 ]; then
+      ip="$(basename $first).$(basename $second).$(basename $third).0/24"
+      echo "There's a bad nameserver under $ip." >&2
+      echo "You probably don't want to run any shell scripts." >&2
+     fi
+     for ns in $third/ns/* ; do
+      if [ "$(cat $ns | tr -d '0-9.\n' | wc -c)" != 0 ]; then
+       ip="$(basename $first).$(basename $second).$(basename $third).0/24"
+       nsname="$(basename $ns)"
+       echo "There's a bad nameserver IP under $ip, for" >&2
+       echo " $nsname" >&2
+       echo "You probably don't want to run any shell scripts." >&2
+      fi
+     done
+    done
+   done
+  fi
+ done
+fi
diff --git a/scripts/hex2dec b/scripts/hex2dec
new file mode 100755
index 0000000000000000000000000000000000000000..7b66be966f794ebfd4f5c7456c70cf7fe2a77c1a
--- /dev/null
+++ b/scripts/hex2dec
@@ -0,0 +1,9 @@
+#!/bin/sh
+(
+ echo -n "ibase=16; "
+ if [ x"$1" = x ]; then
+  cat
+ else
+  echo "$1"
+ fi
+) | bc -q
diff --git a/scripts/nameserver_autogen/tinydns_tld_datafile b/scripts/nameserver_autogen/tinydns_tld_datafile
index ff84576f4df7680b85bcd944428b8b1aa9b77615..
index ..0a1174fc35bedf28596de887262f560b9c3c99fa 100755
--- a/scripts/nameserver_autogen/tinydns_tld_datafile
+++ b/scripts/nameserver_autogen/tinydns_tld_datafile
@@ -4,6 +4,23 @@ if ! ./scripts/check_db_safety; then
 fi
 tldsrvrname="$(./scripts/conf_var tinydns__tldsrvrname uz5fvb7zdqyuz4q8ysjdfuf04kzd2lrt0l6fp4uyguxdg5tfut06ck.anons.somerandomnick.ano)"
 tldsrvrip="$(./scripts/conf_var tinydns__tldsrvrip 1.0.27.37)"
+for tld in db/ip/* ; do
+ first="$(basename $tld | ./scripts/hex2dec)"
+ tldname="$first.in-addr.arpa"
+ echo "+$tldsrvrname:$tldsrvrip:3600"
+ echo ".$tldname::$tldsrvrname"
+ for ip in $tld/*/* ; do
+  third="$(basename $ip | ./scripts/hex2dec)"
+  second="$(basename $(dirname $ip) | ./scripts/hex2dec)"
+  first="$(basename $(dirname $(dirname $ip)) | ./scripts/hex2dec)"
+  domain="$third.$second.$first.in-addr.arpa"
+  for ns in $ip/ns/* ; do
+   nsip="$(cat $ns)"
+   nsname="$(basename $ns)"
+   echo "&$domain:$nsip:$nsname"
+  done
+ done
+done
 for tld in db/dom/* ; do
  tldname="$(basename $tld)"
  echo "+$tldsrvrname:$tldsrvrip:3600"

-----END OF PAGE-----