X-Git-Url: https://the.earth.li/gitweb/?a=blobdiff_plain;f=autodns.pl;h=2b973ee4efe39c52273c1e31e9465d7c72e8537b;hb=96c671ffe24694d4d9cf92052cabcd1ca4a13122;hp=9a739d0c16be5a08035975984ac2a6c3738c6d72;hpb=69f62eb3272157eca2f045f051c44a95efca1279;p=autodns.git diff --git a/autodns.pl b/autodns.pl index 9a739d0..2b973ee 100755 --- a/autodns.pl +++ b/autodns.pl @@ -1,9 +1,12 @@ #!/usr/bin/perl -Tw -# autodns 0.0.5 -# Copyright 1999-2001 Project Purple. Written by Jonathan McDowell +# autodns 0.0.7 +# Copyright 1999-2004 Project Purple. Written by Jonathan McDowell # See ACKNOWLEDGEMENTS file for full details of contributors. # http://www.earth.li/projectpurple/progs/autodns.html # Released under the GPL. +# +# $Id: autodns.pl,v 1.4 2004/04/08 10:48:35 noodles Exp $ +# use strict; use IPC::Open3; @@ -16,7 +19,7 @@ my ($user, $server, $inprocess, $delcount, $addcount, $reload_command); my ($domain, @MAIL, @GPGERROR, @COMMANDS, %zones); my ($me, $ccreply, $conffile, $domainlistroot, @cfgfiles, $VERSION); -$VERSION="0.0.5"; +$VERSION="0.0.7"; # # Local configuration here (until it gets moved to a config file). @@ -84,13 +87,15 @@ sub getzones { # These are: a-z, 0-9, - or . # sub valid_domain { - my $domain = shift; - $domain = lc $domain; - if ($domain =~ /^(?:[a-z0-9-]+\.)+[a-z]{2,4}$/) { - return 1; - } else { - return 0; - } + my $domain = shift; + $domain = lc $domain; + if ($domain =~ /^(?:[a-z0-9-]+\.)+[a-z]{2,4}$/) { + return 1; + } elsif ($domain =~ /^(?:[0-9\/-]+\.)+in-addr.arpa$/) { + return 1; + } else { + return 0; + } } # @@ -200,7 +205,7 @@ print REPLY <>$conffile"); print DOMAINSFILE " ### Domain added for '$user' @@ -318,7 +326,7 @@ foreach (@COMMANDS) { zone \"$domain\" { type slave; masters { $server; }; - file \"secondary/$user/$domain\"; + file \"secondary/$user/$df\"; allow-transfer { none; }; allow-query { any; }; };\n";