forked from mtusi2026/mtusi2026lab7
Выполнить лабораторную 7 по безопасности мессенджера
This commit is contained in:
Executable
+13
@@ -0,0 +1,13 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
: "${TARGET_INSTANCE_ID:?TARGET_INSTANCE_ID is required}"
|
||||
cd "$(dirname "$0")/.."
|
||||
for container in $(docker compose ps -q api); do
|
||||
instance=$(docker exec "$container" cat /run/local/instance 2>/dev/null || true)
|
||||
if [ "$instance" = "$TARGET_INSTANCE_ID" ]; then
|
||||
docker stop --time 3 "$container" >/dev/null
|
||||
exit 0
|
||||
fi
|
||||
done
|
||||
echo "No API container matches the requested process alias" >&2
|
||||
exit 1
|
||||
Reference in New Issue
Block a user