Files
IPZ_1/docker/stop.sh
2026-05-17 16:04:22 +02:00

18 lines
385 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
CONTAINER="ewc2025-mysql"
RUNTIME="docker"
if [[ "${1:-}" == "--podman" ]]; then
RUNTIME="podman"
fi
if ! ${RUNTIME} ps -a --format '{{.Names}}' | grep -q "^${CONTAINER}$"; then
echo "Container '${CONTAINER}' does not exist."
exit 0
fi
${RUNTIME} stop "${CONTAINER}"
echo "Container '${CONTAINER}' stopped. Data volume preserved."