equal
deleted
inserted
replaced
2 |
2 |
3 use warnings; |
3 use warnings; |
4 use strict; |
4 use strict; |
5 use File::Path; |
5 use File::Path; |
6 use FindBin; |
6 use FindBin; |
|
7 use my::Config qw(get_config); |
7 |
8 |
8 # liest die Konfiguration ein |
9 # liest die Konfiguration ein |
9 my @configs = ("$FindBin::Bin/dnstools.conf", "/etc/dnstools.conf"); |
10 my %config = get_config("$FindBin::Bin/dnstools.conf", "/etc/dnstools.conf"); |
10 my %config; |
|
11 |
|
12 foreach (grep { -f } @configs) { |
|
13 open(CONFIG, $_) or die "Can't open $_: $!\n"; |
|
14 } |
|
15 |
|
16 unless (seek(CONFIG, 0, 0)) { |
|
17 die "Can't open config (searched: @configs)\n"; |
|
18 } |
|
19 |
|
20 while (<CONFIG>) { |
|
21 chomp; |
|
22 s/#.*//; |
|
23 s/\t//g; |
|
24 s/\s//g; |
|
25 next unless length; |
|
26 my ($cname, $ccont) = split(/\s*=\s*/, $_, 2); |
|
27 $config{$cname} = $ccont; |
|
28 } |
|
29 close(CONFIG); |
|
30 |
11 |
31 my $master_dir = $config{"master_dir"}; |
12 my $master_dir = $config{"master_dir"}; |
32 my $conf_dir = $config{"zone_conf_dir"}; |
13 my $conf_dir = $config{"zone_conf_dir"}; |
33 |
14 |
34 for (@ARGV) { |
15 for (@ARGV) { |