ntp.sysvinit 936 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #! /bin/sh
  2. #
  3. # System-V init script for the openntp daemon
  4. #
  5. set -e
  6. PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
  7. DESC="network time protocol daemon"
  8. NAME=ntpd
  9. DAEMON=/usr/sbin/$NAME
  10. # Gracefully exit if the package has been removed.
  11. test -x $DAEMON || exit 0
  12. # Read config file if it is present.
  13. if [ -r /etc/default/$NAME ]
  14. then
  15. . /etc/default/$NAME
  16. fi
  17. case "$1" in
  18. start) echo -n "Starting $DESC: $NAME"
  19. start-stop-daemon -S -q -x $DAEMON
  20. echo "."
  21. ;;
  22. stop) echo -n "Stopping $DESC: $NAME"
  23. start-stop-daemon -K -q -n $NAME
  24. echo "."
  25. ;;
  26. reload|force-reload) echo -n "Reloading $DESC configuration..."
  27. start-stop-daemon -K -q -n $NAME -s 1
  28. echo "done."
  29. ;;
  30. restart) echo -n "Restarting $DESC: $NAME"
  31. start-stop-daemon -K -q -n $NAME
  32. sleep 1
  33. start-stop-daemon -S -q -x $DAEMON
  34. echo "."
  35. ;;
  36. *) echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2
  37. exit 1
  38. ;;
  39. esac
  40. exit 0