Files
opensim-docker/image-opensim/stop-opensim.sh
T
Robert Adams 479aa9114a Rename the configuration directories to "config-${CONFIG_NAME}"
to make the configuration directories clearer and easier to understand.
2022-02-05 20:42:18 +00:00

27 lines
753 B
Bash
Executable File

#! /bin/bash
# Stop the running opensimulator
BASE=$(pwd)
export CONFIG_NAME=${CONFIG_NAME:-standalone}
# This export fakes out the environment setup script to look for files in
# build environment rather than in run environment.
export OPENSIMBIN=$BASE
source config/scripts/setEnvironment.sh
unset OPENSIMBIN
# Use the generic docker-compose file or the one specific to the configuration if it exists
cd "$BASE"
COMPOSEFILE=./docker-compose.yml
if [[ -e "config/config-${CONFIG_NAME}/docker-compose.yml" ]] ; then
COMPOSEFILE="config/config-${CONFIG_NAME}/docker-compose.yml"
fi
echo "Stopping configuration $CONFIG_NAME from \"$COMPOSEFILE\""
docker-compose \
--file "$COMPOSEFILE" \
--project-name opensim-standalone \
down