forked from mtusi2026/mtusi2026lab7
Щербацевич-БПИ2302-на 3
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
cd "$(dirname "$0")/.."
|
||||
: "${TARGET_INSTANCE_ID:?missing TARGET_INSTANCE_ID}"
|
||||
ids=$(docker compose --env-file .env ps -q api)
|
||||
for id in $ids; do
|
||||
host=$(docker inspect -f '{{.Config.Hostname}}' "$id")
|
||||
if [ "$host" = "$TARGET_INSTANCE_ID" ]; then
|
||||
docker stop -t 2 "$id" >/dev/null
|
||||
exit 0
|
||||
fi
|
||||
done
|
||||
echo "api instance was not found" >&2
|
||||
exit 1
|
||||
Reference in New Issue
Block a user