equal
deleted
inserted
replaced
5 use FindBin; |
5 use FindBin; |
6 use File::Basename; |
6 use File::Basename; |
7 |
7 |
8 sub del_double { |
8 sub del_double { |
9 |
9 |
10 # entfernt doppelte eintraege in einer liste |
10 # remove duplicate entries |
11 my %all; |
11 my %all; |
12 grep { $all{$_} = 0 } @_; |
12 grep { $all{$_} = 0 } @_; |
13 return (keys %all); |
13 return (keys %all); |
14 } |
14 } |
15 |
15 |
16 sub read_conf { |
16 sub read_conf { |
17 |
17 |
18 # liest die Konfiguration ein |
18 # read the configuration |
19 my @configs = ("$FindBin::Bin/dnstools.conf", "/etc/dnstools.conf"); |
19 my @configs = ("$FindBin::Bin/dnstools.conf", "/etc/dnstools.conf"); |
20 our %config; |
20 our %config; |
21 |
21 |
22 for (grep { -f } @configs) { |
22 for (grep { -f } @configs) { |
23 open(CONFIG, $_) or die "Can't open $_: $!\n"; |
23 open(CONFIG, $_) or die "Can't open $_: $!\n"; |
37 } |
37 } |
38 close(CONFIG); |
38 close(CONFIG); |
39 } |
39 } |
40 |
40 |
41 sub add_argv { |
41 sub add_argv { |
42 |
42 # checked whether the zones in argv are managed zones and |
43 # prueft ob zonen aus ARGV verwaltete zonen sind |
43 #inserted them into the list new_serial |
44 # und fuegt sie, falls ja in die liste @new_serial ein |
|
45 our @new_serial; |
44 our @new_serial; |
46 our $master_dir; |
45 our $master_dir; |
47 my $zone; |
46 my $zone; |
48 |
47 |
49 for (@ARGV) { |
48 for (@ARGV) { |
77 } |
76 } |
78 |
77 |
79 } |
78 } |
80 |
79 |
81 sub sign_end { |
80 sub sign_end { |
82 our $sign_alert_time; # die zeit zwischen dem ende und der neuen |
81 our $sign_alert_time; # the time between the end and the new signing |
83 # signierung (siehe externe konfiguration) |
82 # (see external configuration) |
84 our $master_dir; |
83 our $master_dir; |
85 our @new_serial; |
84 our @new_serial; |
86 |
85 |
87 # erzeugt $time (die zeit ab der neu signiert werden soll) |
86 # erzeugt $time (die zeit ab der neu signiert werden soll) |
88 chomp(my $unixtime = `date +%s`); |
87 chomp(my $unixtime = `date +%s`); |