bundles/docker-engine: exit "start" action early if container is running

this happens on daemon restarts
This commit is contained in:
Franzi 2025-02-23 13:16:52 +01:00
parent fed5cbfc52
commit 9edf9111a1
Signed by: kunsi
GPG key ID: 12E3D2136B818350

View file

@ -17,7 +17,12 @@ PGID="$(id -g "${user}")"
if [ "$ACTION" == "start" ]
then
docker rm "${name}" || true
# just exit if the container is actually running already.
set +e
/usr/local/share/icinga/plugins/check_docker_container "${name}" && exit 0
set -e
docker rm "${name}" || true
docker run -d \
--name "${name}" \