1
0
ketr.chat/shell
James Ketrenos 390c881487 Project seeded
Signed-off-by: James Ketrenos <james@ketrenos.com>
2023-03-30 10:33:34 -07:00

25 lines
576 B
Bash
Executable File

#!/bin/bash
container=$(docker-compose ps -q)
if [[ "${container}" == "" ]]; then
>&2 echo "ketr.chat not running. Try './launch'"
exit 1
fi
name=$(docker container ls -f id="${container}" --format "{{.Names}}")
if [[ "${name}" == "" ]]; then
>&2 echo "No container name found for ${container}"
exit 1
fi
command="${@}"
command="${command:-/opt/scripts/shell}"
if [[ "${name}" =~ -production ]]; then
echo "Starting shell in PRODUCTION"
docker exec -it "${name}" ${command}
else
echo "Starting shell in DEVELOPMENT"
docker exec -it "${name}" ${command}
fi