mirror of
https://github.com/willfarrell/docker-crontab.git
synced 2025-04-04 14:05:11 +02:00
fix sub script broken quote
This commit is contained in:
parent
5507ffd878
commit
332af352b9
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user