#! /bin/sh
#
# chkconfig: - 60 20
# description: Network Time Protocol 

# processname: ntpd

# Get config.
. /etc/sysconfig/network

# Get functions
. /etc/rc.d/init.d/functions

# Check that networking is up.
if [ ${NETWORKING} = "no" ] ; then
	exit 0
fi

# See how we were called.
case "$1" in
  start)
	echo -n "Starting NTP services: "
	daemon /usr/local/bin/ntpd -l /var/log/ntp.d
	echo
	touch /var/lock/subsys/ntpd
	;;
  stop)
	echo -n "Stopping NTP services: "
	killproc ntpd
	echo
	rm -f /var/lock/subsys/ntpd
	;;
  status)
	status ntpd
	;;
  restart)
	$0 stop
	$0 start
	;;
  *)
	echo "Usage: $0 {start|stop|status|restart}"
	exit 1
	;;
esac

exit 0
