summaryrefslogtreecommitdiffstats
path: root/dns_wizard
diff options
context:
space:
mode:
authorAntoine Ginies <aginies@mandriva.com>2004-01-19 14:38:14 +0000
committerAntoine Ginies <aginies@mandriva.com>2004-01-19 14:38:14 +0000
commit38f2c6795a18041331d4dede4fe8582789773e6e (patch)
treebe52e8c7ee253f29460b922a1bbe77ad99c9cb17 /dns_wizard
parentb0cc90dc3c37cd5f36c9b4eecc80533d86216064 (diff)
downloaddrakwizard-38f2c6795a18041331d4dede4fe8582789773e6e.tar
drakwizard-38f2c6795a18041331d4dede4fe8582789773e6e.tar.gz
drakwizard-38f2c6795a18041331d4dede4fe8582789773e6e.tar.bz2
drakwizard-38f2c6795a18041331d4dede4fe8582789773e6e.tar.xz
drakwizard-38f2c6795a18041331d4dede4fe8582789773e6e.zip
debug remove host in DNS
Diffstat (limited to 'dns_wizard')
-rw-r--r--dns_wizard/Bind.pm21
1 files changed, 10 insertions, 11 deletions
diff --git a/dns_wizard/Bind.pm b/dns_wizard/Bind.pm
index 1fa11d24..ce59d3a3 100644
--- a/dns_wizard/Bind.pm
+++ b/dns_wizard/Bind.pm
@@ -83,6 +83,7 @@ sub list_hosts {
my $iprev = get_spe_ip('iprev', $IPSERVER);
my $db = "$ZONE_DIR/db.$iprev.hosts";
my $ipnor = get_spe_ip('iprev', $IPSERVER);
+ push @list_hosts, "";
foreach (cat_($db)) {
my ($h) = /\d{1,3}\tIN\tPTR\t(.*)/;
!$h or push @list_hosts,$h;
@@ -728,17 +729,15 @@ sub do_it_add {
sub do_it_remove {
return if $::testing;
my $iprev = get_spe_ip('iprev', $IPSERVER);
- my $SNAME= $o->{var}{CLIENTNAME};
-# if (any { /^$SNAME.$DOMAINNAME./ } cat_("$ZONE_DIR/db.$DOMAINNAME.hosts")) {
- substInFile {
- s/^$SNAME.*//;
- } "$ZONE_DIR/db.$DOMAINNAME.hosts";
- substInFile {
- s/\W+\tIN\tPTR\t$SNAME.$//;
- } "$ZONE_DIR/db.$iprev.hosts";
-# } else {
-# return 'error_remove';
-# }
+ my $NAME= $o->{var}{CLIENTNAME};
+ substInFile {
+ s/^\b$NAME.\b.*//;
+ s/^\s*$//;
+ } "$ZONE_DIR/db.$DOMAINNAME.hosts";
+ substInFile {
+ s/^\d+\tIN\tPTR\t$NAME//;
+ s/^\s*$//;
+ } "$ZONE_DIR/db.$iprev.hosts";
system("service named reload");
}