Реализовать лабораторную работу 4

This commit is contained in:
Никита
2026-11-10 10:57:36 +03:00
parent ec540a1a72
commit fbc1773553
103 changed files with 5424 additions and 27 deletions
+13
View File
@@ -0,0 +1,13 @@
#!/bin/sh
set -eu
cd "$(dirname "$0")/.."
test -n "${TARGET_INSTANCE_ID:-}" || { echo "TARGET_INSTANCE_ID is required" >&2; exit 1; }
for id in $(./scripts/compose.sh ps -q api); do
instance="$(docker exec "$id" curl -fsS -D - -o /dev/null http://127.0.0.1:8080/health/live | tr -d '\r' | awk 'tolower($1) == "x-instance-id:" { print $2 }')"
if [ "$instance" = "$TARGET_INSTANCE_ID" ]; then
docker stop --time 8 "$id" >/dev/null
exit 0
fi
done
echo "Requested API instance was not found" >&2
exit 1