diff --git a/DDNS.pm b/DDNS.pm index 8581a99..70e042e 100644 --- a/DDNS.pm +++ b/DDNS.pm @@ -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"; diff --git a/Makefile.PL b/Makefile.PL index 7cefff5..5feacdb 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -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 ', ); diff --git a/bin/addvhost.pl b/bin/addvhost similarity index 100% rename from bin/addvhost.pl rename to bin/addvhost diff --git a/bin/delvhost.pl b/bin/delvhost similarity index 100% rename from bin/delvhost.pl rename to bin/delvhost diff --git a/bin/list-vhosts b/bin/list-vhosts new file mode 100755 index 0000000..8afcfe7 --- /dev/null +++ b/bin/list-vhosts @@ -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"; + } +}