ntpd 923 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #!/bin/sh
  2. ########################################################################
  3. # Begin ntpd
  4. #
  5. # Description : Start Network Time Protocol daemon
  6. #
  7. # Author : milisarge
  8. #
  9. # Version : Milis Linux 2.0
  10. #
  11. ########################################################################
  12. . /etc/rc.d/functions
  13. . /etc/sysconfig/clock
  14. #$LastChangedBy: igor $
  15. #$Date: 2013-08-02 15:27:17 -0500 (Fri, 02 Aug 2013) $
  16. case "$1" in
  17. start)
  18. log_info_msg "Starting ntpd..."
  19. [ -z $TIMEZONE ] && ezport TZ="Turkey"
  20. TZ=$TIMEZONE start_daemon /usr/bin/ntpd -s
  21. evaluate_retval
  22. ;;
  23. stop)
  24. log_info_msg "Stopping ntpd..."
  25. killproc /usr/bin/ntpd
  26. evaluate_retval
  27. ;;
  28. restart)
  29. $0 stop
  30. sleep 1
  31. $0 start
  32. ;;
  33. status)
  34. statusproc /usr/bin/ntpd
  35. ;;
  36. *)
  37. echo "Usage: $0 {start|stop|restart|status}"
  38. exit 1
  39. ;;
  40. esac
  41. # End ntpd