*create a seperate line for every server, otherwise only the first listed server will be usedlilik-openwrt-22.03
@ -1,13 +1,15 @@ | |||||
#!/bin/sh | #!/bin/sh | ||||
SLEEPTIME=10 | |||||
while true | while true | ||||
do | do | ||||
STATUS="$(/usr/sbin/ntpq -c 'rv 0 stratum'|awk -F '=' '{ print $2 }')" | STATUS="$(/usr/sbin/ntpq -c 'rv 0 stratum'|awk -F '=' '{ print $2 }')" | ||||
if [ -n "$STATUS" ] && [ "$STATUS" -lt "16" ] | |||||
if [[ -n "$STATUS" && "$STATUS" -lt "16" ]] | |||||
then | then | ||||
ACTION="stratum" /sbin/hotplug-call ntp | ACTION="stratum" /sbin/hotplug-call ntp | ||||
exit 0 | |||||
SLEEPTIME=660 | |||||
fi | fi | ||||
sleep 10 | |||||
sleep $SLEEPTIME | |||||
done | done |