#!/bin/bash # Healthcheck for Mosquitto # Check if the container is running if ! docker ps --filter "name=mosquitto" --filter "status=running" | grep -q "mosquitto"; then echo "[FAIL] Mosquitto container is not running" exit 1 fi # Basic port check for 1883 if ! (echo > /dev/tcp/localhost/1883) >/dev/null 2>&1; then echo "[FAIL] Mosquitto port 1883 is not reachable" exit 1 fi echo "[OK] Mosquitto is healthy" exit 0