summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Palfrader <peter@palfrader.org>2010-12-01 20:21:44 +0000
committerweasel <weasel@bc3d92e2-beff-0310-a7cd-cc87d7ac0ede>2010-12-01 20:21:44 +0000
commitc472a95641f07047aad7c0192e211017a09bc455 (patch)
treef1af2fdc1d7ffd46751784120dd1e612c3ed9246
parent4fcb44674aea1d2be080b9cbc6dee996580eb4b8 (diff)
And do not hardcode @THISNAMES either
git-svn-id: svn+ssh://asteria.noreply.org/svn/weaselutils/trunk@464 bc3d92e2-beff-0310-a7cd-cc87d7ac0ede
-rwxr-xr-xmake-bindconfig-from-ldap21
1 files 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 (<F>) {
+ 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: