equal
deleted
inserted
replaced
1 #!/usr/bin/perl |
|
2 |
|
3 use warnings; |
|
4 use strict; |
|
5 use File::Path; |
|
6 use FindBin; |
|
7 use DNStools::Config qw(get_config); |
|
8 |
|
9 # liest die Konfiguration ein |
|
10 my %config = get_config("$FindBin::Bin/dnstools.conf", "/etc/dnstools.conf"); |
|
11 |
|
12 my $master_dir = $config{"master_dir"}; |
|
13 my $conf_dir = $config{"zone_conf_dir"}; |
|
14 |
|
15 for (@ARGV) { |
|
16 chomp(my $zone = `idn --quiet "$_"`); |
|
17 |
|
18 if (-d "$master_dir/$zone") { |
|
19 rmtree "$master_dir/$zone/" |
|
20 and print "zone-dir for $zone removed\n"; |
|
21 } |
|
22 else { |
|
23 print "$master_dir/$zone: $!\n"; |
|
24 } |
|
25 |
|
26 if (-e "$conf_dir/$zone") { |
|
27 unlink "$conf_dir/$zone" |
|
28 and print "configuration-file for $zone removed\n"; |
|
29 } |
|
30 else { |
|
31 print "$conf_dir/$zone: $!\n"; |
|
32 } |
|
33 } |
|