This commit is contained in:
@@ -0,0 +1 @@
|
||||
latest
|
||||
@@ -4,6 +4,7 @@ set -eu
|
||||
WATCH_CONTAINER="${WATCH_CONTAINER:?set WATCH_CONTAINER to the container name or id to watch}"
|
||||
RESTART_CONTAINERS="${RESTART_CONTAINERS:?set RESTART_CONTAINERS to a comma-separated list of containers to restart}"
|
||||
POLL_INTERVAL="${POLL_INTERVAL:-30}"
|
||||
RESTART_DELAY="${RESTART_DELAY:-0}"
|
||||
|
||||
# Only restart when status *becomes* unhealthy (avoids restarting every poll while still unhealthy).
|
||||
# Set RESTART_ON_EVERY_POLL=1 to restart on every poll while unhealthy.
|
||||
@@ -27,6 +28,9 @@ restart_list() (
|
||||
else
|
||||
log "restart failed: $c"
|
||||
fi
|
||||
if [ "$RESTART_DELAY" != "0" ]; then
|
||||
sleep "$RESTART_DELAY"
|
||||
fi
|
||||
done
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user