When HOST variable is defined the prerouting and the postrouting segment not executed

This commit is contained in:
2022-06-07 05:57:24 +00:00
parent d0b9777bfb
commit c6d89dad8f

View File

@@ -183,19 +183,19 @@ if [[ "$PREROUTING" == "true" ]] || [[ "$POSTROUTING" == "true" ]] || [[ "$HOST"
if [ "$HOST" == "true" ] ; then if [ "$HOST" == "true" ] ; then
IPTABLES="/sbin/iptables -t nat"; IPTABLES="/sbin/iptables -t nat";
debug "iptables: "$IPTABLES;
else else
IPTABLES="nsenter -t $(docker inspect --format {{.State.Pid}} $NAME) -n -- $IPTABLES -t nat"; IPTABLES="nsenter -t $(docker inspect --format {{.State.Pid}} $NAME) -n -- $IPTABLES -t nat";
debug "iptables: "$IPTABLES; debug "iptables: "$IPTABLES;
fi
if [[ "$PREROUTING" == "true" ]] ; then if [[ "$PREROUTING" == "true" ]] ; then
prerouting; prerouting;
fi fi
if [[ "$POSTROUTING" == "true" ]] ; then if [[ "$POSTROUTING" == "true" ]] ; then
postrouting; postrouting;
fi fi
fi;
else else