28 lines
829 B
Bash
Executable File
28 lines
829 B
Bash
Executable File
#!/bin/bash
|
|
set -e
|
|
|
|
START=${FIRST_WEAVE:-1}
|
|
COUNT=${NUM_WEAVES:-28}
|
|
FINISH=$((FIRST_WEAVE+COUNT-1))
|
|
|
|
case "$1" in
|
|
launch)
|
|
if [ $START -ne 1 ] ; then
|
|
status=$(docker inspect --format='{{.State.Running}} {{.NetworkSettings.IPAddress}}' weave$((START-1)))
|
|
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)
|
|
PREV="${status#true }"
|
|
echo $ID $PREV
|
|
done
|
|
;;
|
|
stop)
|
|
for i in $(seq $START $FINISH); do
|
|
echo Stopping weave$i
|
|
WEAVE_CONTAINER_NAME=weave$i ./weave --local stop
|
|
done
|
|
;;
|
|
esac
|