diff options
author | cathugger <cathugger@cock.li> | 2018-07-19 14:05:14 +0000 |
---|---|---|
committer | cathugger <cathugger@cock.li> | 2018-07-19 14:05:14 +0000 |
commit | febca5dadfbaaaa67661b8004008fbc9f5856363 (patch) | |
tree | 12d450d8690b0a3023d073cb22dca276d9ee9199 | |
parent | 55b99d960f0357181b7558dd48e444481fb02822 (diff) | |
download | resdb-febca5dadfbaaaa67661b8004008fbc9f5856363.tar.gz resdb-febca5dadfbaaaa67661b8004008fbc9f5856363.zip |
add missing cidr entry, fix abslimit's IP entry, tweak bind autogen script
-rw-r--r-- | db/ip/15/0A/0B/cidr (renamed from db/ip/15/0A/0B/00/cidr) | 0 | ||||
-rw-r--r-- | db/ip/15/0A/0B/owner (renamed from db/ip/15/0A/0B/00/owner) | 0 | ||||
-rw-r--r-- | db/ip/15/3F/46/cidr | 1 | ||||
-rwxr-xr-x | scripts/addmissingcidr.sh | 31 | ||||
-rwxr-xr-x | scripts/nameserver_autogen/bind_tld_zonefile.sh | 4 |
5 files changed, 34 insertions, 2 deletions
diff --git a/db/ip/15/0A/0B/00/cidr b/db/ip/15/0A/0B/cidr index 4c6cc51..4c6cc51 100644 --- a/db/ip/15/0A/0B/00/cidr +++ b/db/ip/15/0A/0B/cidr diff --git a/db/ip/15/0A/0B/00/owner b/db/ip/15/0A/0B/owner index 7796f04..7796f04 100644 --- a/db/ip/15/0A/0B/00/owner +++ b/db/ip/15/0A/0B/owner diff --git a/db/ip/15/3F/46/cidr b/db/ip/15/3F/46/cidr new file mode 100644 index 0000000..1348f8d --- /dev/null +++ b/db/ip/15/3F/46/cidr @@ -0,0 +1 @@ +21.63.70.0/24 diff --git a/scripts/addmissingcidr.sh b/scripts/addmissingcidr.sh new file mode 100755 index 0000000..3ee2607 --- /dev/null +++ b/scripts/addmissingcidr.sh @@ -0,0 +1,31 @@ +#!/bin/sh +# adds missing ip/*/*/cidr entries + +cd db || exit 1 +cd ip || exit 1 +for a in * +do + [ -e "$a" ] || continue + ia=$((0x$a)) || exit 1 + cd "$a" || exit 1 + for b in * + do + [ -e "$b" ] || continue + ib=$((0x$b)) || exit 1 + cd "$b" || exit 1 + for c in * + do + [ -e "$c" ] || continue + ic=$((0x$c)) || exit 1 + cd "$c" || exit 1 + if [ ! -e cidr ] + then + printf "%d.%d.%d.0/24\n" "$ia" "$ib" "$ic"> cidr + printf "ip/%s/%s/%s %d.%d.%d.0/24\n" "$a" "$b" "$c" "$ia" "$ib" "$ic" >&2 + fi + cd .. + done + cd .. + done + cd .. +done diff --git a/scripts/nameserver_autogen/bind_tld_zonefile.sh b/scripts/nameserver_autogen/bind_tld_zonefile.sh index 823159a..e80edb5 100755 --- a/scripts/nameserver_autogen/bind_tld_zonefile.sh +++ b/scripts/nameserver_autogen/bind_tld_zonefile.sh @@ -27,7 +27,7 @@ fi cd "$RESDB_PATH/db/ip" || exit 1 for PFX in $RDNS_PREFIX;do cd "$RESDB_PATH/db/ip/$PFX" 2>/dev/null || continue - IP=$[0x$PFX] + IP=$((0x$PFX)) DOM=$IP.in-addr.arpa RDNS_ZONEFILE="$ZONEFILE_DIR/$DOM" echo -n "generating IPv4 reverse lookup zonefile for $IP/8..." >&2 @@ -45,7 +45,7 @@ for PFX in $RDNS_PREFIX;do a=$(basename $(dirname $i)) b=$(basename $(dirname $(dirname $i))) c=$(basename $(dirname $(dirname $(dirname $i)))) - ipv4=`printf "%d.%d" $[0x${b}] $[0x${c}]` + ipv4=`printf "%d.%d" $((0x$b)) $((0x$c))` printf "%-7s IN NS %s\n" $ipv4 ${f}. done >> "$RDNS_ZONEFILE".tmp mv -f "$RDNS_ZONEFILE".tmp "$RDNS_ZONEFILE" |