From abe47c7622abaf04bedf7e6d92cd4a87e2cf186e Mon Sep 17 00:00:00 2001 From: gyurix Date: Thu, 19 May 2022 05:29:56 +0000 Subject: [PATCH] Setting prerouting and postrouting rules in one process --- firewall/firewall-add | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/firewall/firewall-add b/firewall/firewall-add index a015d1f..968c587 100755 --- a/firewall/firewall-add +++ b/firewall/firewall-add @@ -183,16 +183,14 @@ if [[ "$PREROUTING" == "true" ]] || [[ "$POSTROUTING" == "true" ]] || [[ "$HOST" IPTABLES="/sbin/iptables -t nat"; else IPTABLES="nsenter -t $(docker inspect --format {{.State.Pid}} $NAME) -n -- $IPTABLES -t nat"; - fi - debug "iptables: "$IPTABLES; + debug "iptables: "$IPTABLES; - if [[ "$PREROUTING" == "true" ]] ; then prerouting; - elif [[ "$POSTROUTING" == "true" ]] ; then - postrouting; - + if [[ "$POSTROUTING" == "true" ]] ; then + postrouting; + fi fi; else