diff options
author | epoch <epoch@hacking.allowed.org> | 2013-11-04 11:56:20 +0000 |
---|---|---|
committer | epoch <epoch@hacking.allowed.org> | 2013-11-04 11:56:20 +0000 |
commit | b3026c3ca3dace96bcb9c6d4b75fca2aa7357f86 (patch) | |
tree | 6889ecfdc778538aea0a1b9cecb0c07b902fdff6 /scripts/nameserver_autogen/bind_tld_zonefile.sh | |
parent | 1c0dfe1d6fbd33f24da3e8bad01acbb7565e6d3d (diff) | |
download | resdb-b3026c3ca3dace96bcb9c6d4b75fca2aa7357f86.tar.gz resdb-b3026c3ca3dace96bcb9c6d4b75fca2aa7357f86.zip |
fixed a bug where I used a literal instead of one of the user defined variables (thx mkz)
Diffstat (limited to 'scripts/nameserver_autogen/bind_tld_zonefile.sh')
-rwxr-xr-x | scripts/nameserver_autogen/bind_tld_zonefile.sh | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/scripts/nameserver_autogen/bind_tld_zonefile.sh b/scripts/nameserver_autogen/bind_tld_zonefile.sh index 06eb802..a86455d 100755 --- a/scripts/nameserver_autogen/bind_tld_zonefile.sh +++ b/scripts/nameserver_autogen/bind_tld_zonefile.sh @@ -2,12 +2,15 @@ #made for bash. not sure if all /bin/sh work. #be sure to edit these variables first. -ANO_ZONEFILE=/etc/namedb/ano -RDNS_ZONEFILE=/etc/namedb/1.in-addr.arpa -RESDB_PATH=/services/resdb/resdb +#ANO_ZONEFILE=/etc/namedb/ano +#RDNS_ZONEFILE=/etc/namedb/1.in-addr.arpa +#RESDB_PATH=/services/resdb/resdb +if [ ! "$ANO_ZONEFILE" ];then + echo "You forgot to set some variables. read the source plzkthx." + exit 0; +fi -cd ${RESDB_PATH}/db/dom/ano echo -n "generating ipv4 reverse lookup zonefile for 1/8..." @@ -17,7 +20,7 @@ echo '@ IN SOA localhost. root.localhost. ('`date +" %Y%m%d%H"`' 60 300 3600000 echo '@ IN NS localhost.' >> "$RDNS_ZONEFILE" echo 'localhost. IN A 127.0.0.1' >> "$RDNS_ZONEFILE" -for i in `ls /services/resdb/resdb/db/ip/01/*/*/ns/*`;do +for i in `ls ${RESDB_PATH}/db/ip/01/*/*/ns/*`;do f=$(basename $i) a=$(basename $(dirname $i)) b=$(basename $(dirname $(dirname $i))) @@ -26,6 +29,8 @@ for i in `ls /services/resdb/resdb/db/ip/01/*/*/ns/*`;do done >> "$RDNS_ZONEFILE" echo done. +cd ${RESDB_PATH}/db/dom/ano + echo -n generating .ano TLD zonefile... echo "; this zonefile genreated on: `date`" > "$ANO_ZONEFILE" @@ -34,6 +39,7 @@ echo '@ IN SOA localhost. root.localhost. ('`date +" %Y%m%d%H"`' 60 300 3600000 echo '@ IN NS localhost.' >> "$ANO_ZONEFILE" echo 'localhost. IN A 127.0.0.1' >> "$ANO_ZONEFILE" + for name in *;do if [ -e "${name}/ns/" ];then for server in "$name"/ns/*;do |