Compare commits

...

2 Commits

Author SHA1 Message Date
Kameron Kenny - pi501 46fbb63489 add health check 2025-06-30 13:38:45 -04:00
Kameron Kenny - pi501 53c07e85a7 update ignore 2025-06-30 13:38:08 -04:00
2 changed files with 26 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
*.log

25
health_check.sh Executable file
View File

@ -0,0 +1,25 @@
#!/usr/bin/env bash
TIMEOUT=2
function no_good {
cd /home/kkenny/src/docker/pihole
git pull
echo "[$(date)] $1 has failed, restarting." >> health.log
docker compose down >> health.log 2>&1
docker compose up $1 -d >> health.log 2>&1
exit 1
}
case $(hostname) in
pi501)
dig google.com @10.200.53.241 >/dev/null 2>&1 || no_good "pihole1"
;;
pi502)
dig google.com @10.200.53.242 >/dev/null 2>&1 || no_good "pihole2"
;;
pi503)
dig google.com @10.200.53.243 >/dev/null 2>&1 || no_good "pihole3"
;;
esac