enable pac domain in apache sites

This commit is contained in:
Peter Hormanns 2019-10-14 14:53:23 +02:00
parent 2d2c320454
commit 4c5e8bb7c3

View File

@ -53,6 +53,7 @@ public class PacProcessorFactory implements EntityProcessorFactory {
createIfUp(pac), createIfUp(pac),
createHttpdVirtualProc(hive), createHttpdVirtualProc(hive),
createSaltCallProc(), createSaltCallProc(),
createLinkSiteProc(pac.getName() + ".hostsharing.net"),
createAccountingRulesProc())); createAccountingRulesProc()));
final Config config = Config.getInstance(); final Config config = Config.getInstance();
for (String queueName : config.getProperty("queues.dns").split(",")) { for (String queueName : config.getProperty("queues.dns").split(",")) {
@ -77,6 +78,7 @@ public class PacProcessorFactory implements EntityProcessorFactory {
createProftpdConfProc(hive), createProftpdConfProc(hive),
createHttpdVirtualProc(hive), createHttpdVirtualProc(hive),
createSaltCallProc(), createSaltCallProc(),
createUnlinkSiteProc(pac.getName() + ".hostsharing.net"),
createSetQuotaProc(pac) createSetQuotaProc(pac)
)); ));
final Config config = Config.getInstance(); final Config config = Config.getInstance();
@ -156,7 +158,18 @@ public class PacProcessorFactory implements EntityProcessorFactory {
} }
private Processor createSaltCallProc() { private Processor createSaltCallProc() {
return new ShellProcessor("salt-call state.sls pacs && invoke-rc.d apache2 reload >/dev/null 2>&1"); return new ShellProcessor("salt-call state.sls pacs >/dev/null 2>&1");
}
private Processor createLinkSiteProc(final String pacDomain) {
return new ShellProcessor("ln -sf /etc/apache2/sites-available/" + pacDomain + " /etc/apache2/sites-enabled/97-" + pacDomain
+ " && invoke-rc.d apache2 reload >/dev/null 2>&1");
}
private Processor createUnlinkSiteProc(final String pacDomain) {
return new ShellProcessor("rm -f /etc/apache2/sites-enabled/97-" + pacDomain
+ " && rm -f /etc/apache2/sites-available/" + pacDomain + ""
+ " && invoke-rc.d apache2 reload >/dev/null 2>&1");
} }
private Processor createZonefileProc(final EntityManager em, final Pac pac) { private Processor createZonefileProc(final EntityManager em, final Pac pac) {