feat: lab3 init
This commit is contained in:
Executable
+12
@@ -0,0 +1,12 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
: "${TARGET_INSTANCE_ID:?TARGET_INSTANCE_ID is required}"
|
||||
case "$TARGET_INSTANCE_ID" in
|
||||
*[!a-fA-F0-9]*|'') echo "Invalid instance id" >&2; exit 2 ;;
|
||||
esac
|
||||
service=$(docker inspect --format '{{ index .Config.Labels "com.docker.compose.service" }}' "$TARGET_INSTANCE_ID")
|
||||
if [ "$service" != api ]; then
|
||||
echo "Target is not a Compose API replica" >&2
|
||||
exit 2
|
||||
fi
|
||||
docker stop -t 1 "$TARGET_INSTANCE_ID" >/dev/null
|
||||
Reference in New Issue
Block a user