From ce886b716416472860e6708b3eca1f9121897a3f Mon Sep 17 00:00:00 2001 From: LinuxSquare Date: Sat, 23 Dec 2023 13:38:11 +0100 Subject: [PATCH] Add stoppod funcitonality --- utils/podman | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/utils/podman b/utils/podman index 4b0cb56..0e9eb45 100644 --- a/utils/podman +++ b/utils/podman @@ -58,4 +58,12 @@ function stoppod() { log e "Podman-directory of ${1} does not exist!" exit 1 fi + + if [[ -z $(podman container ls | grep $(getLocalConfValue $(getValueByKey 'PODMAN_DIRECTORY')/${1} container.name)) ]]; then + log e "Container $(getLocalConfValue $(getValueByKey 'PODMAN_DIRECTORY')/${1} container.name) does not exist!" + exit 1 + fi + + cd "$(getValueByKey 'PODMAN_DIRECTORY')/${1}" + podman-compose down }