diff --git a/check_pihole.sh b/check_pihole.sh index 678600a..6f8b423 100644 --- a/check_pihole.sh +++ b/check_pihole.sh @@ -1,12 +1,18 @@ #!/bin/bash -# Pi-hole service +# 1. FTL muss laufen systemctl is-active --quiet pihole-FTL || exit 1 -# DNS functional test -dig google.com @127.0.0.1 +short | grep -q . || exit 1 +# 2. DNS muss antworten +dig google.com @127.0.0.1 +time=1 +tries=1 +short | grep -q . || exit 1 -# Blocking test (critical!) -dig doubleclick.net @127.0.0.1 +short | grep -q "0.0.0.0" || exit 1 +# 3. Blocking muss funktionieren +dig doubleclick.net @127.0.0.1 +time=1 +tries=1 +short | grep -Eq "0.0.0.0|::" || exit 1 + +# 4. NTP muss synchron sein (DEIN Wunsch!) +timedatectl | grep -q "synchronized: yes" || exit 1 + +# 5. Pi-hole darf nicht disabled sein +pihole status | grep -q "blocking enabled" || exit 1 exit 0 \ No newline at end of file