выполнение ЛР3 на 4

This commit is contained in:
Ilya
2026-10-21 12:20:11 +03:00
parent 0ab3a341aa
commit 6f4f74d691
37 changed files with 2854 additions and 15 deletions
+9
View File
@@ -0,0 +1,9 @@
#!/bin/sh
set -eu
cd "$(dirname "$0")/.."
name=${1:?usage: stop-container.sh <project>-api-N}
case "$name" in *-api-*) ;; *) echo "refusing: $name is not an API replica" >&2; exit 2;; esac
alias=$(docker exec "$name" cat /tmp/instance-id 2>/dev/null || echo "?")
docker stop --time 8 "$name" >/dev/null
printf '%s stopped %s instance=%s state=%s\n' "$(date -u +%Y-%m-%dT%H:%M:%SZ)" "$name" "$alias" \
"$(docker inspect -f '{{.State.Status}}' "$name")" | tee -a evidence/stop-one.txt