sbin/update-serial
changeset 150 3db363880766
parent 136 43e9d618af43
equal deleted inserted replaced
146:a3860111db49 150:3db363880766
    43         "sign-alert-time=i" => \$opt{sign_alert_time},
    43         "sign-alert-time=i" => \$opt{sign_alert_time},
    44         "key-counter-end=i" => \$opt{key_counter_end},
    44         "key-counter-end=i" => \$opt{key_counter_end},
    45         "h|help"            => sub { pod2usage(-exit => 0, -verbose => 1) },
    45         "h|help"            => sub { pod2usage(-exit => 0, -verbose => 1) },
    46         "m|man"             => sub {
    46         "m|man"             => sub {
    47             pod2usage(
    47             pod2usage(
    48                 -exit => 0,
    48                 -exit    => 0,
    49                 -verbose   => 2,
    49                 -verbose => 2,
    50                 # "system('perldoc -V &>/dev/null')" appears shorter, but may not
    50 
    51                 # do what you expect ( it still returns 0 on debian squeeze with
    51                # "system('perldoc -V &>/dev/null')" appears shorter, but may not
    52                 # dash as system shell even if cannot find the command in $PATH)
    52                # do what you expect ( it still returns 0 on debian squeeze with
       
    53                # dash as system shell even if cannot find the command in $PATH)
    53                 -noperldoc => system('perldoc -V >/dev/null 2>&1')
    54                 -noperldoc => system('perldoc -V >/dev/null 2>&1')
    54             );
    55             );
    55         }
    56         }
    56     ) or pod2usage;
    57     ) or pod2usage;
    57 
    58 
    58     # merge the config and the defined options from commandline
    59     # merge the config and the defined options from commandline
    59     my @configs = ( "dnstools.conf", "$ENV{HOME}/.dnstools.conf",
    60     my @configs =
    60         "/etc/dnstools.conf");
    61       ("dnstools.conf", "$ENV{HOME}/.dnstools.conf", "/etc/dnstools.conf");
    61     unshift @configs, $ENV{DNSTOOLS_CONF} if defined $ENV{DNSTOOLS_CONF};
    62     unshift @configs, $ENV{DNSTOOLS_CONF} if defined $ENV{DNSTOOLS_CONF};
    62     %config = get_config @configs, \%opt;
    63     %config = get_config @configs, \%opt;
    63 
    64 
    64     my @candidates = @ARGV ? zones(@ARGV) : changed_zones;
    65     my @candidates = @ARGV ? zones(@ARGV) : changed_zones;
    65     push @candidates, update_index($config{indexzone});
    66     push @candidates, update_index($config{indexzone});
    70 
    71 
    71     push @candidates, begin_rollover(@need_rollover);
    72     push @candidates, begin_rollover(@need_rollover);
    72     push @candidates, end_rollover(@done_rollover);
    73     push @candidates, end_rollover(@done_rollover);
    73 
    74 
    74     foreach my $zone (uniq(@candidates)) {
    75     foreach my $zone (uniq(@candidates)) {
    75 #        say "XXX: candidate $zone";
    76 
       
    77         #        say "XXX: candidate $zone";
    76         update_serial($zone);
    78         update_serial($zone);
    77         sign($zone) if dnssec_enabled($zone, "$config{master_dir}/$config{indexzone}/$config{indexzone}");
    79         sign($zone)
       
    80           if dnssec_enabled($zone,
       
    81                   "$config{master_dir}/$config{indexzone}/$config{indexzone}");
       
    82 
    78 #        say "XXX: $zone should be signed" if dnssec_enabled($zone, "$config{master_dir}/$config{indexzone}/$config{indexzone}");
    83 #        say "XXX: $zone should be signed" if dnssec_enabled($zone, "$config{master_dir}/$config{indexzone}/$config{indexzone}");
    79     }
    84     }
    80 
    85 
    81     file_entry;
    86     file_entry;
    82     mk_zone_conf($config{bind_dir}, $config{zone_conf_dir});
    87     mk_zone_conf($config{bind_dir}, $config{zone_conf_dir});