update initial zonefile for autoconfig

This commit is contained in:
Peter Hormanns 2020-05-06 14:47:38 +02:00
parent 836688d00e
commit 74cceb3564

View File

@ -119,10 +119,14 @@ public class DomainProcessorFactory implements EntityProcessorFactory {
zonefileTemplateVars.put("sio", Long.toString(System.currentTimeMillis()/1000L));
final String domName = dom.getName();
final String zonefileTargetPath = "/etc/bind/pri." + domName;
final Processor zonefileTemplateProcessor =
new VelocityProcessor("/de/hsadmin/mods/dom/zonefile.vm", zonefileTemplateVars, dom, zonefileTargetPath, false);
// final Processor zonefileTemplateProcessor =
// new VelocityProcessor("/de/hsadmin/mods/dom/zonefile.vm", zonefileTemplateVars, dom, zonefileTargetPath, false);
final Processor getZonefileProcessor = new ShellProcessor("echo \"{DEFAULT_ZONEFILE}\" | /usr/local/sbin/gen-zonefile > " + zonefileTargetPath);
final Processor zonefileACLProcessor =
new ShellProcessor("chown root:bind " + zonefileTargetPath + " && chmod 644 " + zonefileTargetPath);
new ShellProcessor("chown root:bind " + zonefileTargetPath + " && chmod 644 " + zonefileTargetPath);
final String hiveName = dom.getUser().getHiveName();
final Query domsQuery = em.createQuery("SELECT d FROM Domains d WHERE d.user.pac.hive.name = :hivename");
domsQuery.setParameter("hivename", hiveName);
@ -153,7 +157,7 @@ public class DomainProcessorFactory implements EntityProcessorFactory {
"|| ( mv /etc/bind/named.pri-zones.tmp /etc/bind/named.pri-zones && invoke-rc.d bind9 reload )")
);
final Processor dnsSetupProcessor =
new CompoundProcessor(zonefileTemplateProcessor, zonefileACLProcessor, prizonesFileProcessor);
new CompoundProcessor(getZonefileProcessor, zonefileACLProcessor, prizonesFileProcessor);
return dnsSetupProcessor;
}