diff options
author | Peter Palfrader <peter@palfrader.org> | 2010-12-01 20:12:57 +0000 |
---|---|---|
committer | weasel <weasel@bc3d92e2-beff-0310-a7cd-cc87d7ac0ede> | 2010-12-01 20:12:57 +0000 |
commit | 4fcb44674aea1d2be080b9cbc6dee996580eb4b8 (patch) | |
tree | e742706b3b3b22caba7c67f950e6fa398fcb8724 | |
parent | 3a14873f716c3c5e506359ef8da14e68c057034b (diff) |
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
-rwxr-xr-x | make-bindconfig-from-ldap | 8 |
1 files changed, 6 insertions, 2 deletions
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 { |