diff options
| author | Joe Carstairs <me@joeac.net> | 2026-06-26 14:08:37 +0100 |
|---|---|---|
| committer | Joe Carstairs <me@joeac.net> | 2026-06-29 07:32:35 +0100 |
| commit | c6ff40e28894417d87ee7858438f28fc262ffb40 (patch) | |
| tree | 6709abcec3a294c5a0d6fa56f91ecb3fdf573d5e /openrc | |
| parent | 86509e2598fc5689b00b770e793c348988b32187 (diff) | |
moves openrc -> openrc/init.d
Diffstat (limited to 'openrc')
| -rwxr-xr-x | openrc/init.d/joeac.net (renamed from openrc/joeac.net) | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/openrc/joeac.net b/openrc/init.d/joeac.net index 3a45694..afe79bd 100755 --- a/openrc/joeac.net +++ b/openrc/init.d/joeac.net @@ -47,18 +47,19 @@ status() { pods=0 started=0 while read pod; do + pod_service="$(podman inspect $pod | jq .[0].Config.Labels.[\"com.docker.compose.service\"])" + if ! [ "$pod_service" = "\"${MODULENAME}\"" ]; then + continue + fi pods=$(($pods+1)) if podman top $pod &>/dev/null; then einfo "status: [$pod] started" - started=$(($started+1)) + exit 0 else einfo "status: [$pod] stopped" + exit 3 fi - done < <("${COMPOSECMD}" -f "${COMPOSEFILE}" ps --quiet ${MODULENAME}) - if [ $started -eq $pods ]; then - einfo "status: started" - else - einfo "status: stopped" - return 3 - fi + done < <("${COMPOSECMD}" -f "${COMPOSEFILE}" ps --quiet) + einfo "status: no container found for ${MODULENAME}" + exit 3 } |
