summaryrefslogtreecommitdiff
path: root/make-bindconfig-from-ldap
diff options
context:
space:
mode:
Diffstat (limited to 'make-bindconfig-from-ldap')
-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: