linkpi_firmware_history/rootfs/link/shell/ntp.sh

16 lines
310 B
Bash

. /link/shell/util/func.sh
while [ true ]
do
jopen /link/config/ntp.json
if [ `jget enable` == "true" ]; then
if ! procExists ntpd ;then
ntpd -p `jget server` -Nnq
fi
sleep $((`jget interval`*60))
else
pkill ntpd
fi
sleep 1
done