themactep / thingino-firmware

Open-source firmware for Ingenic SoC IP cameras
https://thingino.com
MIT License
159 stars 50 forks source link

ntp: create /tmp/sync_status when ntp is synchronized + webui #256

Open nicolasroche898 opened 1 day ago

nicolasroche898 commented 1 day ago

Add a file /tmp/sync_status that signals that ntp time is synchronized.

Scripts that depend on synchronized time, for example writing files with correct timestamps, can wait for existence of the file using:

#!/bin/sh

# wait for time synchronization:

while [ ! -e "/tmp/sync_status" ]; do
    sleep 1;
done

echo "time synchronized! proceeding..."

Added also current sync status in config-time web ui:

screenshot_time