Files
mtusi2026lab7/scripts/stop-one.sh
T
sashadugina06 11390b65fd
Skeleton contracts / contracts (pull_request) Blocked by required conditions
feat: complete lab 7 for grade 4
2026-12-04 13:55:32 +03:00

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