docker-compose/thinkcentre/nextcloud/lan-healthcheck.sh

15 lines
381 B
Bash
Executable File

#!/bin/bash
source .env
CONTAINER_NAME="mariadb-main"
# Check if the Docker container is running on the remote host
if ssh "$USER@$MYSQL_HOST" "docker ps -q -f name=$CONTAINER_NAME" >/dev/null 2>&1; then
echo "Docker container $CONTAINER_NAME is running on $MYSQL_HOST"
exit 0
else
echo "Docker container $CONTAINER_NAME is not running on $MYSQL_HOST"
exit 1
fi