translate_container_name.sh 170 B

12345678910
  1. #!/bin/sh
  2. translate_container_name () {
  3. if docker container inspect "$1" > /dev/null 2>&1; then
  4. echo "$1"
  5. else
  6. echo "$1" | sed 'y/_/-/'
  7. fi
  8. }