From f542ba9ec13ffb82bf817d33e340d5203c280070 Mon Sep 17 00:00:00 2001 From: Julien Kassar Date: Sun, 23 Oct 2016 23:49:21 -0400 Subject: [PATCH] Update condition equal --- docker.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker.sh b/docker.sh index 4b3a5d4..aa78932 100644 --- a/docker.sh +++ b/docker.sh @@ -68,7 +68,7 @@ if [ `echo ${containers} | wc -c` -gt "1" ] ; then iptables -t nat -A POSTROUTING -s ${ipaddr}/32 -d ${ipaddr}/32 -p ${dst_proto} -m ${dst_proto} --dport ${dst_port} -j MASQUERADE - if [ $src_ip = "0.0.0.0" ] ; then + if [ $src_ip == "0.0.0.0" ] ; then iptables -t nat -A DOCKER ! -i ${DOCKER_NET_INT} -p ${dst_proto} -m ${dst_proto} --dport ${src_port} -j DNAT --to-destination ${ipaddr}:${dst_port} else iptables -t nat -A DOCKER -d ${src_ip}/32 ! -i ${DOCKER_NET_INT} -p ${dst_proto} -m ${dst_proto} --dport ${src_port} -j DNAT --to-destination ${ipaddr}:${dst_port}