--- a/dnssec-sign Thu Aug 12 10:18:58 2010 +0200
+++ b/dnssec-sign Fri Aug 13 10:09:37 2010 +0200
@@ -41,17 +41,22 @@
my @zone_sig_content;
my $sig_date;
my $kc;
+my $serial_up = 0;
+
+for (@ARGV) {
+ if ( $_ eq "-s" ) {
+ $serial_up = 1;
+ shift @ARGV;
+ }
+}
# prueft zonen aus ARGV und fuegt sie in die liste @manu ein
for (@ARGV) {
chomp( my $zone = `idn --quiet "$_"` );
- if ( -e "$master_dir/$zone" ) {
+ if ( -e "$master_dir/$zone/.keycounter" ) {
push @manu, $zone;
}
- else {
- print "$zone ist keine verwaltete zone \n";
- }
}
chomp( my $unixtime = `date +%s` );
@@ -99,6 +104,34 @@
}
}
+#erhoeht den serial der zone
+for ( &del_double( @auto, @manu ) ) {
+ unless ($serial_up == 1) {
+ last
+ }
+
+ $zone = $_;
+ my @zonefile = ();
+ my $serial;
+
+ open ( ZONEFILE, "$master_dir/$zone/$zone")
+ or die "$master_dir/$zone/$zone: $!\n";
+ @zonefile = <ZONEFILE>;
+ close (ZONEFILE);
+
+ for (@zonefile) {
+ if (m#([0-9]{10}).*;.*serial#) {
+ $serial = $1 + 1;
+ s#(.*)([0-9]{10})(.*)#$1$serial$3#;
+ }
+ }
+
+ open ( ZONEFILE, ">$master_dir/$zone/$zone")
+ or die "$master_dir/$zone/$zone: $!\n";
+ print ZONEFILE @zonefile;
+ close (ZONEFILE);
+}
+
# signiert alle zonen in @auto und @manu und erhoeht den wert in
# der keycounter-datei
for ( &del_double( @auto, @manu ) ) {