From c070f0b08c208049cac66ac794380502bfc436b9 Mon Sep 17 00:00:00 2001 From: Matthias Radestock Date: Fri, 28 Nov 2014 10:13:48 +0000 Subject: [PATCH] add `weave stop-dns` and in the process disentangle stopping dns from `weave stop` --- weave | 12 +++++++++--- weavedns/README.md | 2 ++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/weave b/weave index 7eb5164c..4172601d 100755 --- a/weave +++ b/weave @@ -16,6 +16,7 @@ usage() { echo "weave status" echo "weave version" echo "weave stop" + echo "weave stop-dns" echo "weave reset" echo echo "where is of the form [:], and" @@ -523,11 +524,16 @@ case "$COMMAND" in if ! docker kill $CONTAINER_NAME >/dev/null 2>&1 ; then echo "Weave is not running." >&2 fi - docker kill $DNS_CONTAINER_NAME >/dev/null 2>&1 || true - docker rm -f $CONTAINER_NAME >/dev/null 2>&1 || true - docker rm -f $DNS_CONTAINER_NAME >/dev/null 2>&1 || true + docker rm -f $CONTAINER_NAME >/dev/null 2>&1 || true check_command_and_run conntrack -D -p udp --dport $PORT >/dev/null 2>&1 || true ;; + stop-dns) + [ $# -eq 0 ] || usage + if ! docker kill $DNS_CONTAINER_NAME >/dev/null 2>&1 ; then + echo "WeaveDNS is not running." >&2 + fi + docker rm -f $DNS_CONTAINER_NAME >/dev/null 2>&1 || true + ;; reset) [ $# -eq 0 ] || usage docker kill $CONTAINER_NAME >/dev/null 2>&1 || true diff --git a/weavedns/README.md b/weavedns/README.md index fe5350ea..c50b20c6 100644 --- a/weavedns/README.md +++ b/weavedns/README.md @@ -20,6 +20,8 @@ $ weave run 10.1.1.25/24 -ti -h pingme.weave.local ubuntu $ shell1=$(weave run --with-dns 10.1.1.26/24 -ti -h ubuntu.weave.local ubuntu) $ docker attach $shell1 +The DNS container can be stopped with `stop-dns`. + # ping pingme ... ```