From: Jonathan McDowell Date: Wed, 15 Jun 2005 10:41:53 +0000 (+0000) Subject: cscvs to tla changeset 7 X-Git-Url: https://the.earth.li/gitweb/?a=commitdiff_plain;h=7cff990ef4df44469d5bed817fda2292931a74ae;p=autodns.git cscvs to tla changeset 7 Author: noodles Date: 2005/04/08 11:45:12 Move config out to a config file. git-archimport-id: noodles@earth.li--pie/autodns--mainline--1.0--patch-6 --- diff --git a/autodns.conf b/autodns.conf new file mode 100644 index 0000000..b320c27 --- /dev/null +++ b/autodns.conf @@ -0,0 +1,31 @@ +# +# AutoDNS config file. +# +# These are sort of suitable for a Debian setup. +# + +# Who I should reply as. +$me="autodns\@earth.li"; + +# Who replies should be CCed to. +$ccreply="noodles\@earth.li"; + +# Where to look for zones we're already hosting. +@cfgfiles=("/etc/bind/named.conf", + "/etc/bind/named.secondary.conf"); + +# The file we should add/delete domains from. +$conffile="/etc/bind/named.secondary.conf"; + +# The file that contains details of the authorized users. +$usersfile="/etc/bind/autodns.users"; + +# Base file name to for list of users domains. +$domainlistroot="/etc/bind/domains."; + +# The lockfile we use to ensure we have exclusive access to the +# $domainlistroot$user files and $conffile. +$lockfile="/etc/bind/autodns.lck"; + +# The command to reload the nameserver domains list. +$reload_command="sudo ndc reconfig 2>&1"; diff --git a/autodns.pl b/autodns.pl index a2b4dd9..cfa9510 100755 --- a/autodns.pl +++ b/autodns.pl @@ -5,7 +5,7 @@ # http://www.earth.li/projectpurple/progs/autodns.html # Released under the GPL. # -# $Id: autodns.pl,v 1.6 2005/04/08 11:37:16 noodles Exp $ +# $Id: autodns.pl,v 1.7 2005/04/08 11:45:12 noodles Exp $ # use strict; @@ -24,36 +24,15 @@ my ($me, $ccreply, $conffile, $domainlistroot, @cfgfiles, $VERSION); $VERSION="0.0.7"; # -# Local configuration here (until it gets moved to a config file). +# Load our config # -# These are sort of suitable for a Debian setup. -# - -# Who I should reply as. -$me="autodns\@earth.li"; - -# Who replies should be CCed to. -$ccreply="noodles\@earth.li"; - -# Where to look for zones we're already hosting. -@cfgfiles=("/etc/bind/named.conf", - "/etc/bind/named.secondary.conf"); - -# The file we should add/delete domains from. -$conffile="/etc/bind/named.secondary.conf"; - -# The file that contains details of the authorized users. -$usersfile="/etc/bind/autodns.users"; - -# Base file name to for list of users domains. -$domainlistroot="/etc/bind/domains."; - -# The lockfile we use to ensure we have exclusive access to the -# $domainlistroot$user files and $conffile. -$lockfile="/etc/bind/autodns.lck"; - -# The command to reload the nameserver domains list. -$reload_command="sudo ndc reconfig 2>&1"; +my $file = '/etc/bind/autodns.conf'; +unless (my $ret = do $file) { + warn "Couldn't parse $file\n" if $@; + warn "Couldn't do $file\n" unless defined $ret; + warn "Couldn't run $file\n" unless $ret; + die "Problem reading config file!\n"; +} ### ### There should be no need to edit anything below (unless you're not