From 5646148b7ef642f2db66047dc855cc55e5580990 Mon Sep 17 00:00:00 2001
From: Peter Hormanns <peter.hormanns@hostsharing.net>
Date: Mon, 19 Dec 2011 12:15:35 +0100
Subject: [PATCH] make default gw configurable

---
 hsarback/src/de/hsadmin/mods/pac/PacProcessorFactory.java    |    7 ++++++-
 hsarback/src/de/hsadmin/mods/dom/DomainProcessorFactory.java |    4 +++-
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/hsarback/src/de/hsadmin/mods/dom/DomainProcessorFactory.java b/hsarback/src/de/hsadmin/mods/dom/DomainProcessorFactory.java
index 069d70b..d6d17f7 100644
--- a/hsarback/src/de/hsadmin/mods/dom/DomainProcessorFactory.java
+++ b/hsarback/src/de/hsadmin/mods/dom/DomainProcessorFactory.java
@@ -252,7 +252,9 @@
 		Processor domSetupProcessor = new CompoundProcessor(
 			createDomainDirectoriesProcessor(dom, templateVars),
 			new CreateFileProcessor(selectVHostTemplate(dom), templateVars, "/etc/apache2/sites-generated/" + domName, "root", "root", "644"),
-			new ShellProcessor("ln -sf /etc/apache2/sites-generated/" + domName + " /etc/apache2/sites-enabled/010-" + domName + " && invoke-rc.d apache2 reload >/dev/null 2>&1")
+			new ShellProcessor(
+					"ln -sf /etc/apache2/sites-generated/" + domName + " /etc/apache2/sites-enabled/010-" + domName + 
+					" && invoke-rc.d apache2 reload >/dev/null 2>&1")
 		);
 		return domSetupProcessor;
 	}
diff --git a/hsarback/src/de/hsadmin/mods/pac/PacProcessorFactory.java b/hsarback/src/de/hsadmin/mods/pac/PacProcessorFactory.java
index 6703b21..16e4399 100644
--- a/hsarback/src/de/hsadmin/mods/pac/PacProcessorFactory.java
+++ b/hsarback/src/de/hsadmin/mods/pac/PacProcessorFactory.java
@@ -17,6 +17,7 @@
 import de.hsadmin.core.qserv.ShellProcessor;
 import de.hsadmin.core.qserv.TemplateProcessor;
 import de.hsadmin.core.qserv.WaitingTasksProcessor;
+import de.hsadmin.core.util.Config;
 import de.hsadmin.core.util.PasswordTool;
 import de.hsadmin.mods.user.UnixUser;
 
@@ -184,7 +185,11 @@
 		hiveValues.put("HIVE", hive.getName());
 		String hiveIP = hive.getInetAddr().getInetAddr();
 		hiveValues.put("HIVE_IP", hiveIP);
-		hiveValues.put("HIVE_GATEWAY", hiveIP.substring(0, hiveIP.lastIndexOf('.')) + ".1");
+		String defaultGateway = 
+				Config.getInstance().getProperty("hsadmin.default_gateway", hiveIP.substring(0, hiveIP.lastIndexOf('.')) + ".1");
+		defaultGateway = 
+			Config.getInstance().getProperty("hsadmin." + hive.getName() + ".default_gateway", defaultGateway);
+		hiveValues.put("HIVE_GATEWAY", defaultGateway);
 		return hiveValues;
 	}
 

--
Gitblit v1.9.1