Der Zonenname wird noch etwas gemangelt bevor er als Dateiname dient.
authorheiko
Thu, 27 Jul 2006 11:13:55 +0000
changeset 13 82ecd75a4ee2
parent 12 2a605c25d2c5
child 14 6da0c9f58638
Der Zonenname wird noch etwas gemangelt bevor er als Dateiname dient. (Damit / im Zonennamen sein dürfen).
Makefile
local.pm.ex
--- a/Makefile	Wed Nov 30 07:15:55 2005 +0000
+++ b/Makefile	Thu Jul 27 11:13:55 2006 +0000
@@ -8,6 +8,9 @@
 
 rcdir = /etc/init.d/
 
+all:
+	@perl -c dns-autoslave
+
 stow:
 	install -m 0755 -d $(sbindir)
 	install -m 0755 -d $(rcdir)
--- a/local.pm.ex	Wed Nov 30 07:15:55 2005 +0000
+++ b/local.pm.ex	Thu Jul 27 11:13:55 2006 +0000
@@ -14,11 +14,14 @@
 sub addZone($$) {
     my ($zone, $src) = @_;
 
+    # Filename ist für das File selbst und auch für die Konfig
+    (my $file = $zone) =~ s/[\/&|]/_/g;
+
     my $txt = <<__;
 // Autoadded %time by $0
 zone "$zone" IN {
     type slave;
-    file "/var/cache/bind/slave/$zone";
+    file "/etc/bind/s/$file";
     masters { %masters; };
     allow-query { any; };
     allow-transfer { none; };
@@ -29,7 +32,7 @@
     $txt =~ s/%time/scalar localtime/eg;
     $txt =~ s/%masters/$src/g;
 
-    if (-f ($_ = "/etc/bind/zones.auto/$zone")) {
+    if (-f ($_ = "/etc/bind/zones.d/$file")) {
 	$@ = "$_ already exists";
 	return 0;
     }