zone-mk
changeset 10 d7977be97fa1
parent 9 c45415af9a4b
child 12 5786a8b53c78
--- a/zone-mk	Wed Jun 30 16:48:26 2010 +0200
+++ b/zone-mk	Tue Jul 13 15:32:08 2010 +0200
@@ -18,6 +18,9 @@
 # config
 source dnstools.conf
 
+primary=$PRIMARY
+primary_ip=${PRIMARY_IP:-$(dig +short $primary)}
+
 secondary=$SECONDARY
 secondary_ip=${SECONDARY_IP:-$(dig +short $secondary)}
 
@@ -72,7 +75,7 @@
 	cat <<xxx >$zonefile
 \$ORIGIN $domain.
 \$TTL 1d
-@		IN SOA $this_host. $hostmaster. (
+@		IN SOA $primary. $hostmaster. (
 		$(date +%Y%m%d00)	; serial
 		1d		; refresh
 		2h		; retry
@@ -89,18 +92,17 @@
 
 xxx
 
-	cat <<xxx >$config
-zone "$domain" {
-// Start: $start
-// Invoice: $customer
-// UTF8: $utf8domain
-	type master;
-	file "$master_dir/$domain/$domain.signed";
-	allow-transfer { $secondary_ip; };
-	allow-query { any; };
-};
+	tpage \
+		--define domain="$domain" \
+		--define start="$start" \
+		--define customer="$customer" \
+		--define utf8domain="$utf8domain" \
+		--define file="$master_dir/$domain/$domain" \
+		--define primary_ip="$primary_ip" \
+		--define secondary_ip="$secondary_ip" \
+		templates/named.conf.zone \
+	>$config
 
-xxx
 done