From c472a95641f07047aad7c0192e211017a09bc455 Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Wed, 1 Dec 2010 20:21:44 +0000 Subject: And do not hardcode @THISNAMES either git-svn-id: svn+ssh://asteria.noreply.org/svn/weaselutils/trunk@464 bc3d92e2-beff-0310-a7cd-cc87d7ac0ede --- make-bindconfig-from-ldap | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/make-bindconfig-from-ldap b/make-bindconfig-from-ldap index 2f9fc90..0b7fffe 100755 --- a/make-bindconfig-from-ldap +++ b/make-bindconfig-from-ldap @@ -91,9 +91,21 @@ if ($PROGRAM_NAME =~ m/-host-([a-z0-9]+)$/) { }; 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.}; -#my @THISNAMES = qw{redeemer.devspread.org.}; + + +my @THISNAMES; +my $CONFFILE = '/etc/noreply/make-bindconfig-from-ldap.conf'; +if (-e $CONFFILE) { + open(F, $CONFFILE) or die ("Cannot open $CONFFILE: $!\n"); + for my $line () { + chomp($line); + push @THISNAMES, $line; + }; +} else { + my $fqdn = `hostname -f`; + chomp $fqdn; + push @THISNAMES, $fqdn; +}; my $date = localtime(); open (CONF, ">$NAMEDCONF") or @@ -104,6 +116,9 @@ print CONF << "EOF"; // automatically created by $PROGRAM_NAME from stdin (probably called by ssh) // vim:set syn=named: EOF +for my $thishost (@THISNAMES) { + print CONF "This system is known as $thishost\n"; +}; my @lines = <>; DOMAIN: -- cgit v1.2.3