From 0e9af198a1ff3393abe31d9c203bf63c38c1649b Mon Sep 17 00:00:00 2001 From: heuzef Date: Sat, 18 May 2019 05:58:14 +0200 Subject: [PATCH] surveillance de l'HORLOGE --- scripts/check_services.sh | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/scripts/check_services.sh b/scripts/check_services.sh index d2d25af..9d55222 100755 --- a/scripts/check_services.sh +++ b/scripts/check_services.sh @@ -4,9 +4,39 @@ echo "********************" date +echo "********************" echo -/usr/local/bin/gpio -g write 18 1 +# HORLOGE +if timedatectl status | grep -q 'Time zone: Europe/Paris (CEST, +0200)' +then + if timedatectl status | grep -q 'Network time on: yes' + then + if timedatectl status | grep -q 'NTP synchronized: yes' + then + if timedatectl status | grep -q 'RTC in local TZ: no' + then + echo "[✅ OK] Horloge" + else + echo "[❌ ERREUR] Horloge - RTC in local TZ" + /usr/local/bin/gpio -g write 18 1 + exit + fi + else + echo "[❌ ERREUR] Horloge - NTP not synchronized" + /usr/local/bin/gpio -g write 18 1 + exit + fi + else + echo "[❌ ERREUR] Horloge - Network time is OFF" + /usr/local/bin/gpio -g write 18 1 + exit + fi +else + echo "[❌ ERREUR] Horloge - Bad Timezone" + /usr/local/bin/gpio -g write 18 1 + exit +fi # LOG2RAM if mount | grep -q 'log2ram on /var/log type tmpfs' @@ -58,7 +88,6 @@ else exit fi - # INTERNET # tester 5 ping