diff -r 0342c09abf97 -r d5337081ed02 zone-rm --- a/zone-rm Thu Aug 05 10:49:36 2010 +0200 +++ b/zone-rm Mon Aug 09 11:45:43 2010 +0200 @@ -4,51 +4,48 @@ use File::Path; use FindBin; - # liest die Konfiguration ein -my @configs = ("$FindBin::Bin/dnstools.conf", "/etc/dnstools.conf"); +my @configs = ( "$FindBin::Bin/dnstools.conf", "/etc/dnstools.conf" ); my %config; -foreach (grep {-f} @configs) { - open(CONFIG, $_) or die "Can't open $_: $!\n"; +foreach ( grep {-f} @configs ) { + open( CONFIG, $_ ) or die "Can't open $_: $!\n"; } -unless (seek(CONFIG,0 ,0 )) { - die "Can't open config (searched: @configs)\n" +unless ( seek( CONFIG, 0, 0 ) ) { + die "Can't open config (searched: @configs)\n"; } while () { - chomp; - s/#.*//; - s/\t//g; - s/\s//g; - next unless length; - my ($cname, $ccont) = split (/\s*=\s*/, $_,2); - $config{$cname} = $ccont; + chomp; + s/#.*//; + s/\t//g; + s/\s//g; + next unless length; + my ( $cname, $ccont ) = split( /\s*=\s*/, $_, 2 ); + $config{$cname} = $ccont; } -close (CONFIG); - +close(CONFIG); my $master_dir = $config{"master_dir"}; -my $conf_dir = $config{"zone_conf_dir"}; - +my $conf_dir = $config{"zone_conf_dir"}; for (@ARGV) { - chomp (my $zone = `idn --quiet "$_"`); + chomp( my $zone = `idn --quiet "$_"` ); - if (-d "$master_dir/$zone") { - rmtree "$master_dir/$zone/" and - print "zone-dir for $zone removed\n"; - } - else { - print "$master_dir/$zone: $!\n"; - } - - if (-e "$conf_dir/$zone") { - unlink "$conf_dir/$zone" and - print "configuration-file for $zone removed\n"; - } - else { - print "$conf_dir/$zone: $!\n"; - } + if ( -d "$master_dir/$zone" ) { + rmtree "$master_dir/$zone/" + and print "zone-dir for $zone removed\n"; + } + else { + print "$master_dir/$zone: $!\n"; + } + + if ( -e "$conf_dir/$zone" ) { + unlink "$conf_dir/$zone" + and print "configuration-file for $zone removed\n"; + } + else { + print "$conf_dir/$zone: $!\n"; + } }