view scripts/nameserver_autogen/dnsmasq_tld_conffile @ 262:3dc19203f35f draft

Merge branch 'master' of git://git1.somerandomnick.ano
author Ivo Smits <Ivo@UCIS.nl>
date Fri, 29 Oct 2010 10:30:05 +0200
parents 70a066da663d
children 750fe07d268e
line wrap: on
line source

#!/bin/bash
#
# Call this script directly from the git root and redirect 
# its output to a file.
# This file should then be imported in the dnsmasq.conf 
# using the conf-file=path-to-this-file statement.
#

sh scripts/check_db_safety || exit 1


LS="ls --color=never"

for a in $($LS db/ip/); do
	for b in $($LS db/ip/${a}); do
		for c in $($LS db/ip/${a}/${b}); do
			if [ -d db/ip/${a}/${b}/${c}/ns/ ]; then
			 	for ns in $(cat db/ip/${a}/${b}/${c}/ns/*); do
					A1=$(scripts/hex2dec ${a})
					B1=$(scripts/hex2dec ${b})
					C1=$(scripts/hex2dec ${c})
					STR="server=/${C1}.${B1}.${A1}.in-addr.arpa/${ns}"
					echo $STR
				done
			fi
		done
	done
done

echo

for tld in $($LS db/dom/); do 
	for domain in $($LS db/dom/${tld}/); do 
		for ns in $(cat db/dom/${tld}/${domain}/ns/*); do 
			STR="server=/${domain}.${tld}/${ns}"
			echo $STR
		done; 
	done; 
done