linkpi_firmware_history/rootfs/link/shell/cron.sh

17 lines
346 B
Bash
Raw Normal View History

2024-02-15 22:07:30 +01:00
if [ -f "/link/config/reboot" ]; then
rm /link/config/reboot
reboot
fi
cfg=/link/config/ntp.json
enable=`cat $cfg | grep -o '"enable":[^(,|})]*' | awk -F: '{print $2}'`
server=`cat $cfg | grep -o '"server":[^(,|})]*' | awk -F\" '{print $4}'`
#echo $enable
#echo $server
if [ "$enable" = "true" ]; then
ntpd -p $server
fi
/usr/sbin/crond -d 8