aboutsummaryrefslogtreecommitdiffstats
path: root/tools/docker_stop.sh
diff options
context:
space:
mode:
authorLeonard Kugis <leonard@kug.is>2026-01-31 14:08:20 +0100
committerLeonard Kugis <leonard@kug.is>2026-01-31 14:08:20 +0100
commit94000f6b6d07b31151deccc4e3e1fdccf5b5c487 (patch)
treec0d5450d5d445fc675d899d72de2957d5e6e289b /tools/docker_stop.sh
parent4742f1125021f6bc1a2631c6e54cf6365f9d37f6 (diff)
downloadllm-functions-docker-94000f6b6d07b31151deccc4e3e1fdccf5b5c487.tar.gz
Added docker scripts
Diffstat (limited to 'tools/docker_stop.sh')
-rw-r--r--tools/docker_stop.sh18
1 files changed, 18 insertions, 0 deletions
diff --git a/tools/docker_stop.sh b/tools/docker_stop.sh
new file mode 100644
index 0000000..780a346
--- /dev/null
+++ b/tools/docker_stop.sh
@@ -0,0 +1,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" "$@")"
+