summaryrefslogtreecommitdiff
path: root/scripts/nameserver_autogen/bind_tld_zonefile.sh
diff options
context:
space:
mode:
authorcathugger <cathugger@cock.li>2018-05-12 15:46:46 +0000
committercathugger <cathugger@cock.li>2018-05-12 15:46:46 +0000
commite4535762eef827e763453574dfeab0ff87f3bb2e (patch)
tree55625b98351664105432c927b635cbef6dc6988e /scripts/nameserver_autogen/bind_tld_zonefile.sh
parentfda6593d00fd57b39c628b1b944654d1fb90a7b0 (diff)
downloadresdb-e4535762eef827e763453574dfeab0ff87f3bb2e.tar.gz
resdb-e4535762eef827e763453574dfeab0ff87f3bb2e.zip
a bit more alignment for bind tld zonefile generation
Diffstat (limited to 'scripts/nameserver_autogen/bind_tld_zonefile.sh')
-rwxr-xr-xscripts/nameserver_autogen/bind_tld_zonefile.sh11
1 files changed, 6 insertions, 5 deletions
diff --git a/scripts/nameserver_autogen/bind_tld_zonefile.sh b/scripts/nameserver_autogen/bind_tld_zonefile.sh
index 11edb24..fe78a45 100755
--- a/scripts/nameserver_autogen/bind_tld_zonefile.sh
+++ b/scripts/nameserver_autogen/bind_tld_zonefile.sh
@@ -35,8 +35,8 @@ for PFX in $RDNS_PREFIX;do
echo '$TTL 3600' >> "$RDNS_ZONEFILE".tmp
echo '$ORIGIN' $DOM >> "$RDNS_ZONEFILE".tmp
echo '@ IN SOA @ root ('`date -u +" %Y%m%d%H"`' 60 300 3600000 3600 )' >> "$RDNS_ZONEFILE".tmp
- echo '@ IN NS @' >> "$RDNS_ZONEFILE".tmp
- echo '@ IN A 127.0.0.1' >> "$RDNS_ZONEFILE".tmp
+ echo '@ IN NS @' >> "$RDNS_ZONEFILE".tmp
+ echo '@ IN A 127.0.0.1' >> "$RDNS_ZONEFILE".tmp
for i in */*/ns/*;do
[ -e "$i" ] || continue
@@ -44,7 +44,8 @@ for PFX in $RDNS_PREFIX;do
a=$(basename $(dirname $i))
b=$(basename $(dirname $(dirname $i)))
c=$(basename $(dirname $(dirname $(dirname $i))))
- printf "%d.%d IN NS %s\n" $[0x${b}] $[0x${c}] ${f}.
+ 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"
echo " done." >&2
@@ -61,8 +62,8 @@ for TLD in $TLDS;do
echo '$TTL 3600' >> "$ANO_ZONEFILE".tmp
echo '$ORIGIN' $TLD >> "$ANO_ZONEFILE".tmp
echo '@ IN SOA @ root ('`date -u +" %Y%m%d%H"`' 60 300 3600000 3600 )' >> "$ANO_ZONEFILE".tmp
- echo '@ IN NS @' >> "$ANO_ZONEFILE".tmp
- echo '@ IN A 127.0.0.1' >> "$ANO_ZONEFILE".tmp
+ echo '@ IN NS @' >> "$ANO_ZONEFILE".tmp
+ echo '@ IN A 127.0.0.1' >> "$ANO_ZONEFILE".tmp
for name in *;do
if [ -e "$name/ns/" ];then