# HG changeset patch # User Heiko Schlittermann # Date 1281438228 -7200 # Node ID 7ca31b207366dc5a9866cc8bbeb7d9709d0fba68 # Parent 654be00c18eeffe8acd36c25ca95a9987ec49596# Parent 7df21c1807a62871ff0f0eef6ac43f92a5eb3e3e merged diff -r 654be00c18ee -r 7ca31b207366 .perltidyrc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.perltidyrc Tue Aug 10 13:03:48 2010 +0200 @@ -0,0 +1,2 @@ +--paren-tightness=2 +--square-bracket-tightness=2 diff -r 654be00c18ee -r 7ca31b207366 update-serial --- a/update-serial Mon Aug 02 15:50:54 2010 +0200 +++ b/update-serial Tue Aug 10 13:03:48 2010 +0200 @@ -1,5 +1,8 @@ #! /usr/bin/perl # (c) 1998 Heiko Schlittermann +# +# … work in progress do integrate dnssec (branch suess) +# # Update the serial numbers in zone files # The serial number needs to match a specified pattern (see # the line marked w/ PATTERN. @@ -15,17 +18,23 @@ use File::Basename; use File::Copy; + +#my $dnssec_sign = "../dnstools/dnssec-sign"; +my $master_dir = "/etc/bind/master"; + my $ME = basename $0; my @tmpfiles; my $verbose = 0; my $opt_yes = 0; +my @Zones; +my $file; sub cleanup() { unlink @tmpfiles; } END { cleanup(); } -$ARGV[0] eq "-y" and $opt_yes = 1, shift; -my @Zones = @ARGV ? @ARGV : ; +@ARGV and $ARGV[0] eq "-y" and $opt_yes = 1, shift; +@Zones = @ARGV ? @ARGV : glob("$master_dir/*"); MAIN: { @@ -40,12 +49,16 @@ while (my $file = shift @Zones) { + + my $file_basename = basename($file); + + $file =~ s#($master_dir)(/.*)#$1$2$2#; local (*I, *O); my $done = 0; my $new = "$file.$$.tmp"; my $bak = "$file.bak"; - my $stamp = dirname($file) . "/.stamp/" . basename($file); + my $stamp = $master_dir . "/.stamp/" . basename($file); $file =~ /(\.bak|~)$/ and next; $file !~ /\./ and next; @@ -75,6 +88,10 @@ print " bumping to $sdate$scount"; s/$serial/$sdate$scount/; + # dnssec - new sign + system "cd ../dnstools && ./dnssec-sign $file_basename"; + #die "$dnssec_sign not found ($!)" if $? == -1; + exit 1 if $?; }; print O; } @@ -115,11 +132,8 @@ } else { print "** No PID of a running named found. Please reload manually.\n"; } - } - } - # vim:ts=4:sw=4:ai:aw: