Fix various linter issues

Found via shellcheck.
This commit is contained in:
Iago López Galeiras
2017-01-09 16:20:24 +01:00
parent ec0b6dd8d0
commit 43d9f38c5e
34 changed files with 268 additions and 227 deletions

View File

@@ -4,11 +4,11 @@ set -ex
readonly ARG="$1"
if ! $(weave status 1>/dev/null 2>&1); then
if ! weave status 1>/dev/null 2>&1; then
WEAVE_NO_PLUGIN=y weave launch
fi
eval $(weave env)
eval "$(weave env)"
start_container() {
local IMAGE=$2
@@ -17,12 +17,12 @@ start_container() {
shift 3
local HOSTNAME=$BASENAME.weave.local
for i in $(seq $REPLICAS); do
if docker inspect $BASENAME$i >/dev/null 2>&1; then
docker rm -f $BASENAME$i
for i in $(seq "$REPLICAS"); do
if docker inspect "$BASENAME""$i" >/dev/null 2>&1; then
docker rm -f "$BASENAME""$i"
fi
if [ "$ARG" != "-rm" ]; then
docker run -d --name=$BASENAME$i --hostname=$HOSTNAME $@ $IMAGE
docker run -d --name="$BASENAME""$i" --hostname="$HOSTNAME" "$@" "$IMAGE"
fi
done
}
@@ -33,6 +33,6 @@ start_container 1 redis redis
start_container 1 tomwilkie/qotd qotd
start_container 1 tomwilkie/echo echo
start_container 2 tomwilkie/app app
start_container 2 tomwilkie/frontend frontend --add-host=dns.weave.local:$(weave docker-bridge-ip)
start_container 2 tomwilkie/frontend frontend --add-host=dns.weave.local:"$(weave docker-bridge-ip)"
start_container 1 tomwilkie/client client

View File

@@ -4,11 +4,11 @@ set -ex
readonly ARG="$1"
if ! $(weave status 1>/dev/null 2>&1); then
if ! weave status 1>/dev/null 2>&1; then
WEAVE_NO_PLUGIN=y weave launch
fi
eval $(weave env)
eval "$(weave env)"
start_container() {
local replicas=$1
@@ -30,14 +30,14 @@ start_container() {
;;
esac
done
local container_args="$@"
local container_args="$*"
for i in $(seq ${replicas}); do
if docker inspect ${basename}${i} >/dev/null 2>&1; then
docker rm -f ${basename}${i}
for i in $(seq "${replicas}"); do
if docker inspect "${basename}""${i}" >/dev/null 2>&1; then
docker rm -f "${basename}""${i}"
fi
docker run -d -e CHECKPOINT_DISABLE --name=${basename}${i} --hostname=${hostname} \
${docker_args} ${image} ${container_args}
docker run -d -e CHECKPOINT_DISABLE --name="${basename}""${i}" --hostname="${hostname}" \
"${docker_args}" "${image}" "${container_args}"
done
}