From cf09d424e29c383b299424ed9301d496862c01de Mon Sep 17 00:00:00 2001 From: Gitouche <26656-gitouche@users.noreply.framagit.org> Date: Sat, 12 Feb 2022 13:11:28 +0100 Subject: [PATCH] 40_stop : fix logique --- _podman-common/40_stop_container.sh | 4 ++++ _podman-common/40_stop_pod.sh | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/_podman-common/40_stop_container.sh b/_podman-common/40_stop_container.sh index dcd9e06..e98d587 100755 --- a/_podman-common/40_stop_container.sh +++ b/_podman-common/40_stop_container.sh @@ -15,6 +15,10 @@ if check_systemd_unit_exists ${service_name}; then systemctl --user stop ${service_name} && echo Systemd service ${service_name} stopped. fi + # Leave if container is correctly stopped + if ! check_container_running ${container_name}; then + exit 0 + fi fi # Check if running through podman (no systemd), stop with podman stop , then exit diff --git a/_podman-common/40_stop_pod.sh b/_podman-common/40_stop_pod.sh index bb59c71..3fe661f 100755 --- a/_podman-common/40_stop_pod.sh +++ b/_podman-common/40_stop_pod.sh @@ -15,6 +15,10 @@ if check_systemd_unit_exists ${service_name}; then systemctl --user stop ${service_name} && echo Systemd service ${service_name} stopped. fi + # Leave if pod is correctly stopped + if ! check_pod_running ${container_name}; then + exit 0 + fi fi # Check if running through podman (no systemd), stop with podman stop , then exit