FELIX-1915 - [karaf] allow overridding of etc/system.properties via environment


git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@887277 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/karaf/main/src/main/java/org/apache/felix/karaf/main/Main.java b/karaf/main/src/main/java/org/apache/felix/karaf/main/Main.java
index f9c6985..bd128d2 100644
--- a/karaf/main/src/main/java/org/apache/felix/karaf/main/Main.java
+++ b/karaf/main/src/main/java/org/apache/felix/karaf/main/Main.java
@@ -697,8 +697,8 @@
         // Perform variable substitution on specified properties.
         for (Enumeration e = props.propertyNames(); e.hasMoreElements();) {
             String name = (String) e.nextElement();
-            System.setProperty(name,
-                    substVars(props.getProperty(name), name, null, null));
+            String value = System.getProperty(name, props.getProperty(name));
+            System.setProperty(name, substVars(value, name, null, null));
         }
     }