diff --git a/check_docker.sh b/check_docker.sh new file mode 100644 index 0000000..11d583b --- /dev/null +++ b/check_docker.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +# List of expected container names +expected_containers=("vaultwarden" "nginx" "mariadb") + +# Email settings +recipient="paserver@uni-bremen.de" +subject="Docker Container Alert" + +# Check containers +for container in "${expected_containers[@]}"; do + if ! docker ps --format '{{.Names}}' | grep -q "^$container$"; then + echo "Container $container is not running" | mail -s "$subject" "$recipient" + fi +done