Skip to content

Commit

Permalink
Update IPTables save method
Browse files Browse the repository at this point in the history
  • Loading branch information
frogfather authored and grkvlt committed Oct 3, 2018
1 parent c3d71a2 commit 37233b5
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ public static String firewalldServiceIsActive() {
*
*/
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")));
}

/**
Expand Down

0 comments on commit 37233b5

Please sign in to comment.