Files
mtusi2026lab3/scripts/stop-one.sh

11 lines
379 B
Bash
Executable File

#!/bin/sh
set -eu
cd "$(dirname "$0")/.."
case "${TARGET_INSTANCE_ID:-}" in
api1|api2) target="$TARGET_INSTANCE_ID" ;;
*) echo 'Expected TARGET_INSTANCE_ID=api1 or api2' >&2; exit 2 ;;
esac
docker compose --env-file .env stop -t 3 "$target"
# Only a nonsecret service alias, used by verification to prove both targets.
printf '%s\n' "$target" > evidence/last-stopped.txt