Advertisement
Guest User

Untitled

a guest
Oct 15th, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. #!/bin/bash
  2. set -e -u -o pipefail
  3.  
  4. declare -A containers
  5. declare -A paths
  6.  
  7. [[ -r /etc/default/docker_wrapper ]] && . /etc/default/docker_wrapper
  8.  
  9. callname="${0##*/}"
  10.  
  11. container="${containers[$callname]}"
  12.  
  13. callpath="${callname}"
  14. if [[ -z "${paths[$callname]+xx}" ]]; then
  15. callpath="${callname}"
  16. else
  17. callpath="${paths[$callname]}"
  18. fi
  19.  
  20. params="-i"
  21. # check if we are running in a tty or someone just piped data
  22. [ -t 0 ] && [ -t 1 ] && params="$params -t"
  23.  
  24.  
  25. # Shellcheck: We know what we are doing: These Variables have to be
  26. # expanded if they are multiple arguments. Therefore NO Double-Quotes!
  27. #shellcheck disable=SC2086 disable=SC2128
  28. echo docker_wrapper: executing docker exec ${params} $container "${callpath}" "$@" >/dev/stderr
  29. #shellcheck disable=SC2086 disable=SC2128
  30. eval exec docker exec ${params} $container "${callpath}" "$@"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement