#!/bin/sh
########################################################################
# Begin ntpd
#
# Description : Start Network Time Protocol daemon
#
# Author      : DJ Lucas - dj@linuxfromscratch.org
#               Bruce Dubbs - bdubbs@linuxfromscratch.org
#
# Version     : LFS 7.0
#
########################################################################

### BEGIN INIT INFO
# Provides:            ntpd
# Required-Start:      $time $network
# Should-Start:        $remote_fs
# Required-Stop:       $network
# Should-Stop:         $remote_fs
# Default-Start:       3 4 5
# Default-Stop:        0 1 2 6
# Short-Description:   NTP Network Time Protocol
# Description:         NTP Syncronizes time with time servers worldwide
# X-LFS-Provided-By:   BLFS / LFS 7.0
### END INIT INFO

. /lib/lsb/init-functions

#$LastChangedBy: igor $
#$Date: 2013-08-02 15:27:17 -0500 (Fri, 02 Aug 2013) $

case "$1" in
   start)
      log_info_msg "Starting ntpd..."
      start_daemon /usr/sbin/ntpd -g -u ntp:ntp
      evaluate_retval
      ;;

   stop)
      log_info_msg "Stopping ntpd..."
      killproc /usr/sbin/ntpd
      evaluate_retval
      ;;

   restart)
      $0 stop
      sleep 1
      $0 start
      ;;

   status)
      statusproc /usr/sbin/ntpd
      ;;

   *)
      echo "Usage: $0 {start|stop|restart|status}"
      exit 1
      ;;
esac

# End ntpd

