From 4fcb44674aea1d2be080b9cbc6dee996580eb4b8 Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Wed, 1 Dec 2010 20:12:57 +0000 Subject: Learn source hostname from executable name instead of hardcoding opium git-svn-id: svn+ssh://asteria.noreply.org/svn/weaselutils/trunk@463 bc3d92e2-beff-0310-a7cd-cc87d7ac0ede --- make-bindconfig-from-ldap | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'make-bindconfig-from-ldap') diff --git a/make-bindconfig-from-ldap b/make-bindconfig-from-ldap index 96c805b..2f9fc90 100755 --- a/make-bindconfig-from-ldap +++ b/make-bindconfig-from-ldap @@ -85,7 +85,11 @@ use English; $ENV{'PATH'} = '/bin:/usr/bin'; delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV'}; -my $NAMEDCONF = '/etc/bind/named.conf.from-opium.ldapzones.slave.pushed'; +my $SOURCE_HOST = 'unknown'; +if ($PROGRAM_NAME =~ m/-host-([a-z0-9]+)$/) { + $SOURCE_HOST = $1; +}; +my $NAMEDCONF = "/etc/bind/named.conf.from-$SOURCE_HOST.ldapzones.slave.pushed"; my @RELOAD = qw{/etc/init.d/bind9 reload}; my @THISNAMES = qw{asteria.debian.or.at.}; #my @THISNAMES = qw{seppia.noreply.org. ns3.noreply.org.}; @@ -133,7 +137,7 @@ for my $line (@lines) { print CONF << "EOF"; zone "$domain" { type slave; - file "from-opium-slave-ldap-$domain"; + file "from-$SOURCE_HOST-slave-ldap-$domain"; allow-transfer { "none"; }; allow-query { any; }; masters { -- cgit v1.2.3