#!/bin/bash #==============================================================================# # Dieses Skript prüft, ob der HAProxy läuft und erreichbar ist. #==============================================================================# # Prüfe, ob HAProxy läuft und erreichbar ist HOST="127.0.0.1" PORT=5433 # timeout wichtig, damit Keepalived nicht hängt timeout 1 bash -c "/dev/null 2>&1 if [ $? -eq 0 ]; then exit 0 # OK → VIP behalten else exit 1 # Fehler → VIP abgeben fi