Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- set -e -u -o pipefail
- declare -A containers
- declare -A paths
- [[ -r /etc/default/docker_wrapper ]] && . /etc/default/docker_wrapper
- callname="${0##*/}"
- container="${containers[$callname]}"
- callpath="${callname}"
- if [[ -z "${paths[$callname]+xx}" ]]; then
- callpath="${callname}"
- else
- callpath="${paths[$callname]}"
- fi
- params="-i"
- # check if we are running in a tty or someone just piped data
- [ -t 0 ] && [ -t 1 ] && params="$params -t"
- # Shellcheck: We know what we are doing: These Variables have to be
- # expanded if they are multiple arguments. Therefore NO Double-Quotes!
- #shellcheck disable=SC2086 disable=SC2128
- echo docker_wrapper: executing docker exec ${params} $container "${callpath}" "$@" >/dev/stderr
- #shellcheck disable=SC2086 disable=SC2128
- eval exec docker exec ${params} $container "${callpath}" "$@"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement