From 74dae2abb41554cbe65d77f59bccb08c8d74d128 Mon Sep 17 00:00:00 2001 From: David Wragg Date: Wed, 8 Apr 2015 18:16:10 +0100 Subject: [PATCH] Allow multiweave to be run from any directory --- bin/multiweave | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bin/multiweave b/bin/multiweave index 65855621..23a0491a 100755 --- a/bin/multiweave +++ b/bin/multiweave @@ -5,10 +5,12 @@ START=${FIRST_WEAVE:-1} COUNT=${NUM_WEAVES:-28} FINISH=$((START+COUNT-1)) +weavedir=$(dirname $0)/.. + case "$1" in launch) for i in $(seq $START $FINISH); do - WEAVE_CONTAINER_NAME=weave$i ./weave --local test-launch --connlimit=100 + WEAVE_CONTAINER_NAME=weave$i $weavedir/weave --local test-launch --connlimit=100 done if [ $START -ne 1 ] ; then status=$(docker inspect --format='{{.State.Running}} {{.NetworkSettings.IPAddress}}' weave$((START-1))) @@ -17,7 +19,7 @@ case "$1" in for i in $(seq $START $FINISH); do if [ -n "$PREV" ] ; then echo connecting weave$i to $PREV - WEAVE_CONTAINER_NAME=weave$i ./weave --local connect $PREV + WEAVE_CONTAINER_NAME=weave$i $weavedir/weave --local connect $PREV fi status=$(docker inspect --format='{{.State.Running}} {{.NetworkSettings.IPAddress}}' weave$i) PREV="${status#true }" @@ -26,7 +28,7 @@ case "$1" in stop) for i in $(seq $START $FINISH); do echo Stopping weave$i - WEAVE_CONTAINER_NAME=weave$i ./weave --local stop + WEAVE_CONTAINER_NAME=weave$i $weavedir/weave --local stop done ;; esac