You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

15 lines
250 B

  1. #!/bin/sh
  2. HOTPLUG_SCRIPT=/usr/sbin/ntpd-hotplug
  3. while true
  4. do
  5. STATUS="$(ntpq -c 'rv 0 stratum'|awk -F '=' '{ print $2 }')"
  6. if [ -n "$STATUS" ] && [ "$STATUS" -lt "16" ]
  7. then
  8. ACTION="stratum" /sbin/hotplug-call ntp
  9. exit 0
  10. fi
  11. sleep 10
  12. done