Files
openwrt-packages/net/ntpd/files/ntpd.hotplug-helper
Peter Wagner 06525f0d3b ntpd: cleanup Makefile and hotplug script
Signed-off-by: Peter Wagner <tripolar@gmx.at>
2017-02-05 19:38:37 +01:00

14 lines
221 B
Bash

#!/bin/sh
while true
do
STATUS="$(/usr/sbin/ntpq -c 'rv 0 stratum'|awk -F '=' '{ print $2 }')"
if [ -n "$STATUS" ] && [ "$STATUS" -lt "16" ]
then
ACTION="stratum" /sbin/hotplug-call ntp
exit 0
fi
sleep 10
done