blob: 780a346d9a3cacd7fd60fd45995b6e9416f5fd94 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
#!/usr/bin/env bash
set -euo pipefail
# @describe Stop a sandbox container (it will be removed if started with --rm).
# @option --container! Container name/id to stop.
main() {
local c="${argc_container}"
if docker ps --format '{{.Names}}' | grep -qx "$c"; then
docker stop "$c" >/dev/null
printf '{"container":"%s","status":"stopped"}\n' "$c" >> "$LLM_OUTPUT"
else
printf '{"container":"%s","status":"not-running"}\n' "$c" >> "$LLM_OUTPUT"
fi
}
eval "$(argc --argc-eval "$0" "$@")"
|