From c6d89dad8f633f52f634e81632affcebf4ba01a7 Mon Sep 17 00:00:00 2001 From: gyurix Date: Tue, 7 Jun 2022 05:57:24 +0000 Subject: [PATCH] When HOST variable is defined the prerouting and the postrouting segment not executed --- firewall/firewall-add | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/firewall/firewall-add b/firewall/firewall-add index f474867..2d4a241 100755 --- a/firewall/firewall-add +++ b/firewall/firewall-add @@ -183,19 +183,19 @@ if [[ "$PREROUTING" == "true" ]] || [[ "$POSTROUTING" == "true" ]] || [[ "$HOST" if [ "$HOST" == "true" ] ; then IPTABLES="/sbin/iptables -t nat"; + debug "iptables: "$IPTABLES; else IPTABLES="nsenter -t $(docker inspect --format {{.State.Pid}} $NAME) -n -- $IPTABLES -t nat"; - debug "iptables: "$IPTABLES; - - if [[ "$PREROUTING" == "true" ]] ; then + fi + + if [[ "$PREROUTING" == "true" ]] ; then prerouting; - fi + fi - if [[ "$POSTROUTING" == "true" ]] ; then - postrouting; - fi - fi; + if [[ "$POSTROUTING" == "true" ]] ; then + postrouting; + fi else