Files
mtusi2026lab3/scripts/stop-one.sh
T

12 lines
308 B
Bash
Executable File

#!/bin/sh
set -eu
case "${TARGET_INSTANCE_ID:-}" in
api1|api2) ;;
*) echo 'TARGET_INSTANCE_ID must be api1 or api2' >&2; exit 2 ;;
esac
cd "$(dirname "$0")/.."
if [ -n "${LAB3_PROJECT:-}" ]; then
set -- --project-name "$LAB3_PROJECT"
fi
docker compose "$@" stop --timeout 4 "$TARGET_INSTANCE_ID"