From c35a35fe88a55c7c786bed80bc7aaddd2cd65109 Mon Sep 17 00:00:00 2001 From: duhow Date: Tue, 30 Jan 2024 22:47:33 +0100 Subject: [PATCH] listener: check system date with NTP if old year --- packages/porcupine/config/launcher | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/packages/porcupine/config/launcher b/packages/porcupine/config/launcher index 68ed3fa..9fc124c 100755 --- a/packages/porcupine/config/launcher +++ b/packages/porcupine/config/launcher @@ -47,6 +47,21 @@ set_volume(){ done } +check_date(){ + YEAR=2024 + COUNT=0 + until [ "$COUNT" -ge 5 ]; do + if [ "`date +%Y`" -ge "$YEAR" ]; then + log "all good" + break + fi + log "updating time - times $COUNT" + ntpd -q -p pool.ntp.org + sleep 4 + let COUNT=COUNT+1 + done +} + get_stt_settings(){ #echo "start $(date)" cleanup @@ -109,11 +124,16 @@ if [ "${MODEL}" = "LX06" ]; then RECORDING_CHANNEL=8 fi +log "check date for valid TLS" +check_date log "getting stt settings" get_stt_settings log "ready" cleanup +# clear mute LED +/bin/shut_led 7 + while true; do # program lib model keyword sensitivity ALSA_INPUT