40_stop : fix logique

This commit is contained in:
Gitouche 2022-02-12 13:11:28 +01:00
parent 4cf1444509
commit cf09d424e2
2 changed files with 8 additions and 0 deletions

View File

@ -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

View File

@ -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