first fully functional version for vhosts

This commit is contained in:
2016-02-22 11:35:44 -05:00
parent 5c54c53911
commit 31b1b9ba58
6 changed files with 136 additions and 8 deletions

19
DDNS.pm
View File

@ -98,6 +98,25 @@ sub delvhost {
$this->cleanup();
}
sub getvhosts {
my ($this) = @_;
my $fh;
open($fh, "dig -t AXFR \@127.0.0.1 private.invalid. |")
|| die "Can't open dig: $!";
my @vh;
while (<$fh>) {
if (/^(\S+)._vhosts.private.invalid.\s+\d+\s+IN\s+TXT\s+\"(.+)\"$/) {
push (@vh, { zone => $1,
master => $2 });
}
}
return @vh;
}
sub cleanup {
my ($this) = @_;
# Merge the .jnl file in with the domain file