remove debugging; scripts renamed to omit suffix; added a list for vhosts

This commit is contained in:
2016-02-22 09:11:56 -05:00
parent bf580aee06
commit eb7592d206
5 changed files with 18 additions and 3 deletions

View File

@ -62,7 +62,7 @@ sub __docmd {
close $tmpfh;
my $fh;
open($fh, "|nsupdate -d -k $this->{keyfile} > $filename")
open($fh, "|nsupdate -k $this->{keyfile} > $filename")
|| die "Can't open nsupdate: $!";
print $fh "server localhost\nzone private.invalid.\n$cmd\nshow\nsend\n";

View File

@ -7,8 +7,9 @@ WriteMakefile(
File::Temp => 0.2304,
Regexp::Common => 2013031301,
},
'EXE_FILES' => [ 'bin/addvhost.pl',
'bin/delvhost.pl',
'EXE_FILES' => [ 'bin/addvhost',
'bin/delvhost',
'bin/listvhosts',
],
'AUTHOR' => 'Jorj Bauer <jorj@jorj.org>',
);

14
bin/list-vhosts Executable file
View File

@ -0,0 +1,14 @@
#!/usr/bin/perl
use strict;
use warnings;
my $fh;
open($fh, "dig -t AXFR \@127.0.0.1 private.invalid. |")
|| die "Can't open dig: $!";
while (<$fh>) {
if (/^(\S+)._vhosts.private.invalid.\s+\d+\s+IN\s+TXT\s+\"(.+)\"$/) {
print $1, ". master: ", $2, "\n";
}
}