linkpi_firmware_history/rootfs/link/shell/ntp.sh

16 lines
310 B
Bash
Raw Permalink Normal View History

2024-02-15 22:07:35 +01:00
. /link/shell/util/func.sh
while [ true ]
do
jopen /link/config/ntp.json
if [ `jget enable` == "true" ]; then
if ! procExists ntpd ;then
2024-02-15 22:07:50 +01:00
ntpd -p `jget server` -Nnq
2024-02-15 22:07:35 +01:00
fi
2024-02-15 22:07:50 +01:00
sleep $((`jget interval`*60))
2024-02-15 22:07:35 +01:00
else
pkill ntpd
fi
sleep 1
done