#!/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 Protocal
# Description:         NTP Syncronizes time with time servers worldwide
# X-LFS-Provided-By:   BLFS / LFS 7.0
### END INIT INFO

. /lib/lsb/init-functions

#$LastChangedBy: krejzi $
#$Date: 2012-05-01 19:58:47 +0000 (Tue, 01 May 2012) $

case "$1" in
   start)
      log_info_msg "Starting ntpd..."
      start_daemon /usr/sbin/ntpd -g
      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

