fix sub script broken quote

This commit is contained in:
will Farrell 2017-02-12 21:37:00 -07:00
parent 5507ffd878
commit 332af352b9

View File

@ -30,17 +30,17 @@ make_container_cmd() {
# create bash script to detect all running containers
SCRIPT_NAME=$(cat /proc/sys/kernel/random/uuid)
cat << EOF > ${HOME_DIR}/${SCRIPT_NAME}
!#/bin/bash
#!/usr/bin/env bash
set -e
CONTAINERS=\$(curl --no-buffer -s -XGET --unix-socket ${DOCKER_SOCK} http://localhost/containers/json | jq -r .[].Names[0] | sed 's@/@@')"
CONTAINERS=\$(docker ps --format '{{.Names}}')
for CONTAINER_NAME in \$CONTAINERS; do
if [[ "\${CONTAINER_NAME}" =~ ^${PROJECT}_${CONTAINER}.+ ]]; then
docker exec ${DOCKERARGS} \${CONTAINER_NAME} ${TMP_COMMAND}
fi
done
EOF
echo "sh ${HOME_DIR}/${SCRIPT_NAME}"
echo "/bin/bash ${HOME_DIR}/${SCRIPT_NAME}"
else
echo "docker exec ${DOCKERARGS} ${CONTAINER} ${TMP_COMMAND}"
fi