diff -r 53c95f2ff0ac -r 0e1e5027e9c0 bin/zone-rm --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/bin/zone-rm Sun Jan 23 00:30:15 2011 +0100 @@ -0,0 +1,32 @@ +#!/usr/bin/perl + +use warnings; +use strict; +use File::Path; +use DNStools::Config qw(get_config); + +# liest die Konfiguration ein +my %config = get_config(); + +my $master_dir = $config{"master_dir"}; +my $conf_dir = $config{"zone_conf_dir"}; + +for (@ARGV) { + 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"; + } +}