forked from mtusi2026/mtusi2026lab7
15 lines
470 B
Bash
Executable File
15 lines
470 B
Bash
Executable File
#!/bin/sh
|
|
set -eu
|
|
cd "$(dirname "$0")/.."
|
|
: "${TARGET_INSTANCE_ID:?target API instance required}"
|
|
for service in api-a api-b; do
|
|
actual=$(./scripts/compose.sh exec -T "$service" python /app/uds_probe.py live) || continue
|
|
if [ "$actual" = "$TARGET_INSTANCE_ID" ]; then
|
|
if [ -n "${STOP_ONE_EVIDENCE:-}" ]; then
|
|
printf '%s\n' "$service" > "$STOP_ONE_EVIDENCE"
|
|
fi
|
|
exec ./scripts/compose.sh stop -t 2 "$service"
|
|
fi
|
|
done
|
|
exit 1
|