Don't fail in launch-router if weave2 already exists

And delete weave2 on stop-router.
This commit is contained in:
David Wragg committed 2015-10-16 20:59:06 +01:00
1 parent 23762e0639
commit 3482a7f1f1
1 file changed
+5
+5
View File
@@ -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() {