]> git.pld-linux.org Git - packages/autodns.git/commitdiff
- moved config to separate file
authorPaweł Gołaszewski <blues@pld-linux.org>
Sat, 12 Feb 2005 21:33:01 +0000 (21:33 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    autodns-config.patch -> 1.1
    autodns.conf -> 1.1

autodns-config.patch [new file with mode: 0644]
autodns.conf [new file with mode: 0644]

diff --git a/autodns-config.patch b/autodns-config.patch
new file mode 100644 (file)
index 0000000..f44cb8d
--- /dev/null
@@ -0,0 +1,70 @@
+--- ./autodns.pl.org   2005-02-12 22:29:00.211821472 +0100
++++ ./autodns.pl       2005-02-12 22:29:08.709529624 +0100
+@@ -17,12 +17,15 @@
+ my ($from, $subject, $gpguser, $gpggood, $usersfile, $lockfile, $priv);
+ my ($user, $server, $inprocess, $delcount, $addcount, $reload_command);
+ my ($domain, @MAIL, @GPGERROR, @COMMANDS, %zones);
+-my ($me, $ccreply, $conffile, $domainlistroot, @cfgfiles, $VERSION);
++my ($me, $ccreply, $conffile, $configfile, $domainlistroot, @cfgfiles, $VERSION);
+ $VERSION="0.0.6";
++# Location of config file for autodns:
++$configfile="/etc/autodns.conf";
++
+ #
+-# Local configuration here (until it gets moved to a config file).
++# Defaults - these are used if no config is found.
+ #
+ # These are sort of suitable for a Debian setup.
+ #
+@@ -58,6 +61,40 @@
+ ### using BIND). This statement might even be true now - let me know if not.
+ ###
++# Read config:
++# 
++
++sub getconfig {
++      my ($configfile) = @_;
++      
++      open (AUTODNSCONF, "< $configfile") or
++              &fatalerror("Can't open $configfile, using defaults");
++      
++      while (<AUTODNSCONF>) {
++              if (/^\$mailfrom="([^"]+)";$/) {
++                      $me=$1;
++              } elsif (/^\$ccreply="([^"]+)";$/) {
++                      $ccreply=$1;
++              # FIXME:
++              # make possible to use multiline entries:
++              } elsif (/^\@cfgfiles=(.+);$/) {
++                      @cfgfiles=$1;
++              } elsif (/^\$conffile="([^"]+)";$/) {
++                      $conffile=$1;
++              } elsif (/^\$usersfile="([^"]+)";$/) {
++                      $usersfile=$1;
++              } elsif (/^\$domainlistroot="([^"]+)";$/) {
++                      $domainlistroot=$1;
++              } elsif (/^\$lockfile="([^"]+)";$/) {
++                      $lockfile=$1;
++              } elsif (/^\$reload_command="([^"]+)";$/) {
++                      $reload_command=$1;
++              }
++      }
++      
++      close AUTODNSCONF;
++}
++
+ #
+ # Try to figure out what zones we currently know about by parsing config
+ # files. Sets the item in %zones to 1 for each zone it finds.
+@@ -167,6 +204,8 @@
+       return ($user, $priviledge, $server);
+ }
++getconfig($configfile);
++
+ $delcount=$addcount=$inprocess=0;
+ # Read in the mail from stdin.
diff --git a/autodns.conf b/autodns.conf
new file mode 100644 (file)
index 0000000..41db7fa
--- /dev/null
@@ -0,0 +1,27 @@
+# Who I should reply as.
+$mailfrom="autodns\@earth.li";
+
+# Who replies should be CCed to.
+$ccreply="noodles\@earth.li";
+
+# Where to look for zones we're already hosting.
+# It has to be one line!! (temporary) -- blues 
+#@cfgfiles=("/etc/named.conf", "/etc/bind/named.secondary.conf");
+@cfgfiles=("/etc/named.conf");
+
+# The file we should add/delete domains from.
+$conffile="/etc/named.secondary.conf";
+
+# The file that contains details of the authorized users.
+$usersfile="/etc/autodns/autodns.users";
+
+# Base file name to for list of users domains.
+$domainlistroot="/etc/autodns/domains.";
+
+# The lockfile we use to ensure we have exclusive access to the
+# $domainlistroot$user files and $conffile.
+$lockfile="/var/lib/autodns.lock";
+
+# The command to reload the nameserver domains list.
+$reload_command="sudo ndc reconfig 2>&1";
+
This page took 0.06593 seconds and 4 git commands to generate.