S18ntp 609 B

1234567891011121314151617181920212223242526
  1. #!/bin/sh
  2. ### BEGIN INIT INFO
  3. # Provides:
  4. # Short-Description: Starts ntpd against a custom NTP server
  5. # Description: The clock will synchronize against a user defined NTP server. Useful if the camera is on an isolated network.
  6. ### END INIT INFO
  7. . /opt/wz_mini/wz_mini.conf
  8. case "$1" in
  9. start)
  10. echo "#####$(basename "$0")#####"
  11. if [ ! -z "$NTP_SERVER" ] ; then
  12. # Slight delay required so that we can kill timesync from interfering
  13. (sleep 30 && kill -9 $(pgrep -f timesync) ; /opt/wz_mini/tmp/.bin/ntpd -p "$NTP_SERVER") &
  14. fi
  15. ;;
  16. *)
  17. echo "Usage: $0 {start}"
  18. exit 1
  19. ;;
  20. esac