forked from mtusi2026/mtusi2026lab7
feat: complete lab 7 for grade 4
This commit is contained in:
Executable
+14
@@ -0,0 +1,14 @@
|
||||
#!/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
|
||||
Reference in New Issue
Block a user