HSAdmin Backend Domains, E-Mail, Datenbanken
Peter Hormanns
2020-05-06 74cceb35642e34e0182a16d8ed0f665ac42b4cc5
update initial zonefile for autoconfig
1 files modified
12 ■■■■■ changed files
hsarback/src/de/hsadmin/mods/dom/DomainProcessorFactory.java 12 ●●●●● patch | view | raw | blame | history
hsarback/src/de/hsadmin/mods/dom/DomainProcessorFactory.java
@@ -119,10 +119,14 @@
        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 @@
                    "|| ( 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;
    }