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
248 B

  1. #!/bin/sh
  2. SLEEPTIME=10
  3. while true
  4. do
  5. STATUS="$(/usr/sbin/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. SLEEPTIME=660
  10. fi
  11. sleep $SLEEPTIME
  12. done