brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From grk...@apache.org
Subject [1/2] brooklyn-server git commit: Update IPTables save method
Date Tue, 02 Oct 2018 18:37:07 GMT
Repository: brooklyn-server
Updated Branches:
  refs/heads/frogfather_amend_iptables_save [created] c474231af


Update IPTables save method


Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/77b50be9
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/77b50be9
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/77b50be9

Branch: refs/heads/frogfather_amend_iptables_save
Commit: 77b50be911148c7414dbb1b30364b495b4c8f363
Parents: 97a922d
Author: frogfather <j.a.campbell@icloud.com>
Authored: Mon Oct 1 14:23:15 2018 +0100
Committer: frogfather <j.a.campbell@icloud.com>
Committed: Mon Oct 1 14:23:15 2018 +0100

----------------------------------------------------------------------
 .../main/java/org/apache/brooklyn/util/ssh/IptablesCommands.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/77b50be9/utils/common/src/main/java/org/apache/brooklyn/util/ssh/IptablesCommands.java
----------------------------------------------------------------------
diff --git a/utils/common/src/main/java/org/apache/brooklyn/util/ssh/IptablesCommands.java
b/utils/common/src/main/java/org/apache/brooklyn/util/ssh/IptablesCommands.java
index d504544..c584d33 100644
--- a/utils/common/src/main/java/org/apache/brooklyn/util/ssh/IptablesCommands.java
+++ b/utils/common/src/main/java/org/apache/brooklyn/util/ssh/IptablesCommands.java
@@ -130,8 +130,8 @@ public class IptablesCommands {
      *
      */
     public static String saveIptablesRules() {
-        return alternatives(sudo("service iptables save"),
-                            chain(installPackage("iptables-persistent"), sudo("/etc/init.d/iptables-persistent
save")));
+        return alternatives("if [ ${UID} -eq 0 ] ; then iptables–save > /etc/sysconfig/iptables
; else sudo iptables-save | sudo tee /etc/sysconfig/iptables ; fi",
+                chain(installPackage("iptables-persistent"), sudo("/etc/init.d/iptables-persistent
save")));
     }
 
     /**


Mime
View raw message