summaryrefslogtreecommitdiff
path: root/openrc
diff options
context:
space:
mode:
Diffstat (limited to 'openrc')
-rwxr-xr-xopenrc/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
}