bundles/docker-engine: exit "start" action early if container is running
this happens on daemon restarts
This commit is contained in:
parent
fed5cbfc52
commit
9edf9111a1
1 changed files with 6 additions and 1 deletions
|
@ -17,7 +17,12 @@ PGID="$(id -g "${user}")"
|
||||||
|
|
||||||
if [ "$ACTION" == "start" ]
|
if [ "$ACTION" == "start" ]
|
||||||
then
|
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 \
|
docker run -d \
|
||||||
--name "${name}" \
|
--name "${name}" \
|
||||||
|
|
Loading…
Add table
Reference in a new issue