github.com/cyverse/go-irodsclient@v0.13.2/test/server/stop.sh (about)

     1  #! /bin/bash
     2  cfg=config.inc
     3  
     4  set -o errexit -o nounset -o pipefail
     5  
     6  if [[ "$OSTYPE" == "darwin"* ]]
     7  then
     8    readonly ExecName=$(greadlink -f "$0")
     9  else
    10    readonly ExecName=$(readlink --canonicalize "$0")
    11  fi
    12  
    13  main()
    14  {
    15    local baseDir=$(dirname "$ExecName")
    16  
    17    if [ -z "$cfg" ]
    18    then
    19      printf 'An environment variable include file is needed.\n' >&2
    20      return 1
    21    fi
    22  
    23    . "$baseDir/$cfg"
    24    if ! command -v docker-compose > /dev/null; then
    25      docker compose --file "$baseDir"/docker-compose.yml --project-name "$ENV_NAME" down --remove-orphans
    26    else
    27      docker-compose --file "$baseDir"/docker-compose.yml --project-name "$ENV_NAME" down --remove-orphans
    28    fi
    29  }
    30  
    31  
    32  main "$@"