1 --- ./autodns.pl.org 2005-02-12 22:29:00.211821472 +0100
2 +++ ./autodns.pl 2005-02-12 22:29:08.709529624 +0100
4 my ($from, $subject, $gpguser, $gpggood, $usersfile, $lockfile, $priv);
5 my ($user, $server, $inprocess, $delcount, $addcount, $reload_command);
6 my ($domain, @MAIL, @GPGERROR, @COMMANDS, %zones);
7 -my ($me, $ccreply, $conffile, $domainlistroot, @cfgfiles, $VERSION);
8 +my ($me, $ccreply, $conffile, $configfile, $domainlistroot, @cfgfiles, $VERSION);
12 +# Location of config file for autodns:
13 +$configfile="/etc/autodns.conf";
16 -# Local configuration here (until it gets moved to a config file).
17 +# Defaults - these are used if no config is found.
19 # These are sort of suitable for a Debian setup.
22 ### using BIND). This statement might even be true now - let me know if not.
29 + my ($configfile) = @_;
31 + open (AUTODNSCONF, "< $configfile") or
32 + &fatalerror("Can't open $configfile, using defaults");
34 + while (<AUTODNSCONF>) {
35 + if (/^\$mailfrom="([^"]+)";$/) {
37 + } elsif (/^\$ccreply="([^"]+)";$/) {
40 + # make possible to use multiline entries:
41 + } elsif (/^\@cfgfiles=(.+);$/) {
43 + } elsif (/^\$conffile="([^"]+)";$/) {
45 + } elsif (/^\$usersfile="([^"]+)";$/) {
47 + } elsif (/^\$domainlistroot="([^"]+)";$/) {
49 + } elsif (/^\$lockfile="([^"]+)";$/) {
51 + } elsif (/^\$reload_command="([^"]+)";$/) {
60 # Try to figure out what zones we currently know about by parsing config
61 # files. Sets the item in %zones to 1 for each zone it finds.
63 return ($user, $priviledge, $server);
66 +getconfig($configfile);
68 $delcount=$addcount=$inprocess=0;
70 # Read in the mail from stdin.