Files
mtusi2026lab5/scripts/stop-one.sh
T

12 lines
380 B
Bash
Executable File

#!/bin/sh
set -eu
: "${TARGET_INSTANCE_ID:?test provides target API instance alias}"
cid=$(docker ps -q --filter "label=lab.instance_id=${TARGET_INSTANCE_ID}")
if [ -z "$cid" ]; then
echo "no running API replica for the requested instance" >&2
exit 1
fi
# Leave this replica stopped. Do not stop the database, broker, or load balancer.
docker stop -t 5 $cid >/dev/null
exit 0