more flexibility
This commit is contained in:
1 parent
5648f87717
commit
604d210e55
1 file changed
+10
-5
+10
-5
@@ -1,20 +1,25 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
N_WEAVES=${NUM_WEAVES:-29}
|
START=${FIRST_WEAVE:-1}
|
||||||
|
COUNT=${NUM_WEAVES:-28}
|
||||||
|
FINISH=$((FIRST_WEAVE+COUNT-1))
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
launch)
|
launch)
|
||||||
PREV=
|
if [ $START -ne 1 ] ; then
|
||||||
for i in $(seq 1 $N_WEAVES); do
|
status=$(docker inspect --format='{{.State.Running}} {{.NetworkSettings.IPAddress}}' weave$((START-1)))
|
||||||
ID=$(WEAVE_CONTAINER_NAME=weave$i ./weave --local test-launch --connlimit=$N_WEAVES $PREV)
|
PREV="${status#true }"
|
||||||
|
fi
|
||||||
|
for i in $(seq $START $FINISH); do
|
||||||
|
ID=$(WEAVE_CONTAINER_NAME=weave$i ./weave --local test-launch --connlimit=100 $PREV)
|
||||||
status=$(docker inspect --format='{{.State.Running}} {{.NetworkSettings.IPAddress}}' $ID)
|
status=$(docker inspect --format='{{.State.Running}} {{.NetworkSettings.IPAddress}}' $ID)
|
||||||
PREV="${status#true }"
|
PREV="${status#true }"
|
||||||
echo $ID $PREV
|
echo $ID $PREV
|
||||||
done
|
done
|
||||||
;;
|
;;
|
||||||
stop)
|
stop)
|
||||||
for i in $(seq 1 $N_WEAVES); do
|
for i in $(seq $START $FINISH); do
|
||||||
echo Stopping weave$i
|
echo Stopping weave$i
|
||||||
WEAVE_CONTAINER_NAME=weave$i ./weave --local stop
|
WEAVE_CONTAINER_NAME=weave$i ./weave --local stop
|
||||||
done
|
done
|
||||||
|
|||||||
Reference in new issue
Block a user