Skip to content

Commit

Permalink
Don't fail in launch-router if weave2 already exists
Browse files Browse the repository at this point in the history
And delete weave2 on stop-router.
  • Loading branch information
dpw committed Oct 16, 2015
1 parent 3f08dde commit cb2f9c1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions weave
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -1776,6 +1778,9 @@ case "$COMMAND" in
[ $# -eq 0 ] || usage
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
;;
stop-proxy)
[ $# -eq 0 ] || usage
Expand Down

0 comments on commit cb2f9c1

Please sign in to comment.