Files
IPZ_1/docker/stop.sh
2026-05-17 20:43:31 +02:00

18 lines
383 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
CONTAINER="hotel-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."