The code is quite messy, but particularly the argument parsing and volume-mounting. Also, it doesn't support args with spaces, or non-absolute file-paths.
25 lines
625 B
Bash
Executable File
25 lines
625 B
Bash
Executable File
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
. ./config.sh
|
|
|
|
echo Copying weave images and script to hosts
|
|
for HOST in $HOSTS; do
|
|
docker_on $HOST load -i ../weave.tar
|
|
docker_on $HOST load -i ../weavedns.tar
|
|
docker_on $HOST load -i ../weaveexec.tar
|
|
run_on $HOST mkdir -p bin
|
|
cat ../bin/docker-ns | run_on $HOST sh -c "cat > $DOCKER_NS"
|
|
cat ../weave | run_on $HOST sh -c "cat > ./weave"
|
|
run_on $HOST chmod a+x $DOCKER_NS ./weave
|
|
run_on $HOST sudo service docker restart
|
|
done
|
|
|
|
echo Setting up Docker TLS on hosts
|
|
(cd ./tls && make)
|
|
chmod 0600 tls/*
|
|
for HOST in $HOSTS; do
|
|
rsync -az -e "$SSH" ./tls/ $HOST:~/tls/
|
|
done
|