use hive-inetaddr instead pf pac-inetaddr in namend-hsh.conf

This commit is contained in:
Peter Hormanns 2012-11-14 11:39:59 +01:00
parent 0f7ee2bf1a
commit f60df1baeb

View File

@ -53,10 +53,10 @@ public class DomainProcessorFactory implements EntityProcessorFactory {
templateVars.put("DOM_IPNUMBEREX", getOldIPAddress(pac)); templateVars.put("DOM_IPNUMBEREX", getOldIPAddress(pac));
WaitingTasksProcessor mainProcessor = new WaitingTasksProcessor(createHiveDNSSetupProcessor(domName, templateVars)); WaitingTasksProcessor mainProcessor = new WaitingTasksProcessor(createHiveDNSSetupProcessor(domName, templateVars));
mainProcessor.appendProcessor(hiveName, createHiveEMailSetupProcessor(em, domName), "Setup EMail"); mainProcessor.appendProcessor(hiveName, createHiveEMailSetupProcessor(em, domName), "Setup EMail");
String pacInetAddr = pac.getCurINetAddr().getInetAddr(); String hiveInetAddr = pac.getHive().getInetAddr().getInetAddr();
Config config = Config.getInstance(); Config config = Config.getInstance();
for (String queueName : config.getProperty("queues.dns").split(",")) { for (String queueName : config.getProperty("queues.dns").split(",")) {
mainProcessor.appendProcessor(queueName, createDNSServerSetupProcessor(domName, pacInetAddr), queueName + ".hostsharing.net"); mainProcessor.appendProcessor(queueName, createDNSServerSetupProcessor(domName, hiveInetAddr), queueName + ".hostsharing.net");
} }
for (String queueName : config.getProperty("queues.mail").split(",")) { for (String queueName : config.getProperty("queues.mail").split(",")) {
mainProcessor.appendProcessor(queueName, createMailinSetupProcessor(em, dom, pac), queueName + ".hostsharing.net"); mainProcessor.appendProcessor(queueName, createMailinSetupProcessor(em, dom, pac), queueName + ".hostsharing.net");
@ -157,10 +157,10 @@ public class DomainProcessorFactory implements EntityProcessorFactory {
return emailAdrProcessor; return emailAdrProcessor;
} }
private Processor createDNSServerSetupProcessor(String domName, String pacInetAddr) { private Processor createDNSServerSetupProcessor(String domName, String hiveInetAddr) {
Processor seczonesFileProcessor; Processor seczonesFileProcessor;
seczonesFileProcessor = seczonesFileProcessor =
new ShellProcessor("echo 'zone \"" + domName + "\" { type slave; file \"sec." + domName + "\"; masters { " + pacInetAddr + "; }; };' >>/etc/bind/named-hsh.conf" + new ShellProcessor("echo 'zone \"" + domName + "\" { type slave; file \"sec." + domName + "\"; masters { " + hiveInetAddr + "; }; };' >>/etc/bind/named-hsh.conf" +
" && sort /etc/bind/named-hsh.conf | uniq >/etc/bind/named-hsh.conf.tmp" + " && sort /etc/bind/named-hsh.conf | uniq >/etc/bind/named-hsh.conf.tmp" +
" && mv /etc/bind/named-hsh.conf.tmp /etc/bind/named-hsh.conf" + " && mv /etc/bind/named-hsh.conf.tmp /etc/bind/named-hsh.conf" +
" && invoke-rc.d bind9 reload"); " && invoke-rc.d bind9 reload");