acme-deploy-helpers/one_container_restart

8 lines
267 B
Bash
Executable File

#!/bin/bash
declare container_name="${1:?}"
if systemctl --quiet is-active docker.service; then
if [[ "$( docker container inspect -f '{{.State.Running}}' "${container_name}" 2> /dev/null )" == "true" ]]; then
docker restart "${container_name}"
fi
fi