comparison scripts/nameserver_autogen/bind_tld_zonefile.sh @ 1241:c842697ded21 draft

some tweaks to namegen
author cathugger <cathugger@cock.li>
date Thu, 05 Sep 2019 02:34:52 +0000
parents 24c17a3904b9
children
comparison
equal deleted inserted replaced
1239:42671534ce48 1241:c842697ded21
1 #!/bin/bash 1 #!/bin/bash
2 # made for bash. not sure if all /bin/sh work. 2 # made for bash. not sure if all /bin/sh work.
3 # be sure to set these variables first. 3 # be sure to set these variables first.
4 # please don't edit this file though.
4 #RESDB_PATH=/var/db/resdb 5 #RESDB_PATH=/var/db/resdb
5 #ZONEFILE_DIR=/etc/namedb 6 #ZONEFILE_DIR=/etc/namedb
6 # optional: 7 # optional:
7 : ${TLDS:=ano} 8 : ${TLDS:=ano}
8 : ${RDNS_PREFIX:=21} 9 : ${RDNS_PREFIX:=21}
9 : ${RDNS6_PREFIX:=fd63:1e39:6f73} #not actually used atm. 10 RDNS6_PREFIX=fd63:1e39:6f73 # do not change, hardcoded below
10 11
11 if [ ! "$ZONEFILE_DIR" ];then 12 if [ ! "$ZONEFILE_DIR" ];then
12 echo "You forgot to set some variables. read the source plzkthx." >&2 13 echo "You forgot to set some variables. read the source plzkthx." >&2
13 exit 1 14 exit 1
14 fi 15 fi
15 16
16 DOM="3.7.f.6.9.3.e.1.3.6.d.f.ip6.arpa" 17 DOM="3.7.f.6.9.3.e.1.3.6.d.f.ip6.arpa"
17 RDNS_ZONEFILE="$ZONEFILE_DIR/$DOM" 18 RDNS_ZONEFILE="$ZONEFILE_DIR/$DOM"
18 19
19 echo -n 'generating IPv6 reverse lookup zonefile for...' >&2 20 echo -n "generating IPv6 reverse lookup zonefile for $RDNS6_PREFIX::/48..." >&2
20 echo "; this zonefile generated on: `date -u`" > "$RDNS_ZONEFILE".tmp 21 echo "; this zonefile generated on: `date -u`" > "$RDNS_ZONEFILE".tmp
21 echo '$TTL 3600' >> "$RDNS_ZONEFILE".tmp 22 echo '$TTL 3600' >> "$RDNS_ZONEFILE".tmp
22 echo '$ORIGIN' $DOM. >> "$RDNS_ZONEFILE".tmp 23 echo '$ORIGIN' $DOM. >> "$RDNS_ZONEFILE".tmp
23 echo '@ IN SOA @ root ('`date -u +" %Y%m%d%H"`' 60 300 3600000 3600 )' >> "$RDNS_ZONEFILE".tmp 24 echo '@ IN SOA @ root ('`date -u +" %Y%m%d%H"`' 60 300 3600000 3600 )' >> "$RDNS_ZONEFILE".tmp
24 echo '@ IN NS @' >> "$RDNS_ZONEFILE".tmp 25 echo '@ IN NS @' >> "$RDNS_ZONEFILE".tmp