update states scritp and add refresh status every 5 mins

This commit is contained in:
2026-07-07 19:48:59 +02:00
parent 04a0bef826
commit 0bea772784
4 changed files with 61 additions and 2 deletions
+14
View File
@@ -51,6 +51,20 @@ fi
# Give services time to start
sleep 5
# Lancement du synchro en arrière-plan toutes les X secondes
# Cela garantit que même si un équipement est sur un "autre canal",
# il sera interrogé et mis à jour car on boucle sur la liste globale.
php -r "while(true) { include 'sync_hass_states.php'; sleep(10); }" & SYNC_PID=$!
# Surveillance du processus de synchronisation
while true; do
sleep 60
if [[ -n "$SYNC_PID" && "$SYNC_PID" =~ ^[0-9]+$ ]] && ! kill -0 $SYNC_PID 2>/dev/null; then
echo "ERROR: Sync Service died..." >&2
break
fi
done
# Monitor services
ASW_PID=$(cat AirSendWebService.lock)
while true; do