From 3482a7f1f1ac8f3c7b18df5dc374a13a88ef9122 Mon Sep 17 00:00:00 2001 From: David Wragg Date: Fri, 16 Oct 2015 16:49:12 +0100 Subject: [PATCH] Don't fail in launch-router if weave2 already exists And delete weave2 on stop-router. --- weave | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/weave b/weave index 80a232fb..b9d38f50 100755 --- a/weave +++ b/weave @@ -645,6 +645,8 @@ router_opts_bridge () { setup_router_iface_fastdp() { if [ -n "$WEAVE_PASSWORD" ] ; then # See router_opts_fastdp + # In case there is a lingering weave2 netdev + ip link del $ROUTER_HOSTNETNS_IFNAME >/dev/null 2>&1 || true connect_container_to_bridge $ROUTER_HOSTNETNS_IFNAME && ip link set $ROUTER_HOSTNETNS_IFNAME up fi @@ -1388,6 +1390,9 @@ launch_router() { stop_router() { stop $CONTAINER_NAME "Weave" conntrack -D -p udp --dport $PORT >/dev/null 2>&1 || true + # remove the weave2 netdev in a fastdp context + [ -d /sys/class/net/$BRIDGE -a ! -d /sys/class/net/$BRIDGE/bridge ] \ + && ip link del $ROUTER_HOSTNETNS_IFNAME >/dev/null 2>&1 || true } launch_proxy() {