fixing tsig key use for notifies

This commit is contained in:
2023-10-11 23:47:39 -04:00
parent 0758403058
commit e1068644f3

View File

@ -46,7 +46,7 @@ sub parse_slavefile {
open(my $fh, $f) || die "Can't open $f: $!"; open(my $fh, $f) || die "Can't open $f: $!";
while (<$fh>) { while (<$fh>) {
if (/^zone\s+\"([^\"]+)\"\s+\{.+masters\s?\{\s?(.+);\s?\};\s?\}; allow-notify {"notify-key"}; /) { if (/^zone\s+\"([^\"]+)\"\s+\{.+masters\s?\{\s?(.+);\s?\};/) {
push ( @ret, { zone => $1, push ( @ret, { zone => $1,
master => $2 master => $2
} ); } );
@ -63,7 +63,7 @@ sub do_rewrite {
foreach my $i (sort {$a->{zone} cmp $b->{zone}} @vh) { foreach my $i (sort {$a->{zone} cmp $b->{zone}} @vh) {
next if ($i->{type} eq '_dnssec'); next if ($i->{type} eq '_dnssec');
print $fh "zone \"$i->{zone}\" { type slave; file \"/var/cache/bind/db.$i->{zone}\"; masters { $i->{master}; }; };\n"; print $fh "zone \"$i->{zone}\" { type slave; file \"/var/cache/bind/db.$i->{zone}\"; masters { $i->{master}; allow-notify {key \"notify-key\";}; }; };\n";
} }
close $fh; close $fh;
print "Installing new slave host list\n"; print "Installing new slave host list\n";