Podman support

This commit is contained in:
StewKI
2026-05-17 16:04:22 +02:00
parent 8dae336819
commit 1970610b4d
2 changed files with 17 additions and 7 deletions

View File

@@ -3,10 +3,15 @@ set -euo pipefail
CONTAINER="ewc2025-mysql"
if ! docker ps -a --format '{{.Names}}' | grep -q "^${CONTAINER}$"; then
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
docker stop "${CONTAINER}"
${RUNTIME} stop "${CONTAINER}"
echo "Container '${CONTAINER}' stopped. Data volume preserved."