Merge pull request #697 from paulbellamy/peer-replacement

weave connect/forget take multiple peers

Closes #759.
This commit is contained in:
Matthias Radestock committed 2015-05-27 13:39:50 +01:00
commit 09feb0c53a
4 files changed
+95 -41

No files matched your search

+16 -6
View File
@@ -28,8 +28,8 @@ usage() {
echo "weave launch [-password <password>] [-nickname <nickname>] [-iprange <cidr>] <peer> ..."
echo "weave launch-dns <cidr>"
echo "weave launch-proxy [-H <docker_endpoint>] [--with-dns] [--with-ipam]"
echo "weave connect <peer>"
echo "weave forget <peer>"
echo "weave connect <peer> ..."
echo "weave forget <peer> ..."
echo "weave run [--with-dns] [<cidr> ...] <docker run args> ..."
echo "weave start [<cidr> ...] <container_id>"
echo "weave attach [<cidr> ...] <container_id>"
@@ -562,6 +562,16 @@ echo_addresses() {
echo $1 $2 $3
}
peer_args() {
res=''
sep=''
for p in "$@" ; do
res="$res${sep}peer=$p"
sep="&"
done
echo "$res"
}
######################################################################
# weaveDNS helpers
######################################################################
@@ -878,12 +888,12 @@ case "$COMMAND" in
echo $PROXY_CONTAINER
;;
connect)
[ $# -eq 1 ] || usage
http_call $CONTAINER_NAME $HTTP_PORT POST /connect -d "peer=$1"
[ $# -gt 0 ] || usage
http_call $CONTAINER_NAME $HTTP_PORT POST /connect -d $(peer_args "$@")
;;
forget)
[ $# -eq 1 ] || usage
http_call $CONTAINER_NAME $HTTP_PORT POST /forget -d "peer=$1"
[ $# -gt 0 ] || usage
http_call $CONTAINER_NAME $HTTP_PORT POST /forget -d $(peer_args "$@")
;;
status)
http_call $CONTAINER_NAME $HTTP_PORT GET /status || true