#!/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