From f7d206456159e5bdf107643febe05331d40f213a Mon Sep 17 00:00:00 2001 From: Pete Vander Giessen Date: Thu, 14 Nov 2019 22:55:39 +0000 Subject: [PATCH] set-br-ex now idempotent When refreshing a snap, set-br-ex could fail because the iptables rules that it sets were already setup. We now exit zero if this is true, which prevents us from breaking on upgrades. Change-Id: Ibfee98cabfa3e35bf53dbd191de2cf46f3709a51 --- snap-overlay/bin/setup-br-ex | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/snap-overlay/bin/setup-br-ex b/snap-overlay/bin/setup-br-ex index 0bb507c..710816c 100755 --- a/snap-overlay/bin/setup-br-ex +++ b/snap-overlay/bin/setup-br-ex @@ -18,6 +18,7 @@ ovs-vsctl --retry --may-exist add-br br-ex ip address add $extcidr dev br-ex || : ip link set br-ex up || : -sudo iptables -w -t nat -A POSTROUTING -s $extcidr ! -d $extcidr -j MASQUERADE +sudo iptables -w -t nat -A POSTROUTING -s $extcidr ! \ + -d $extcidr -j MASQUERADE || : exit 0