#!/bin/sh
# $Owl: Owl/packages/openntpd/openntpd.init,v 1.7 2006/09/18 01:53:01 solar Exp $
#
# ntpd		Time synchronization daemon
#
# chkconfig: - 90 60
# description: ntpd is a time synchronization daemon
# processname: ntpd
# config: /etc/ntpd.conf

# Source function library.
. /etc/rc.d/init.d/functions

OWL_STARTUP_ENABLE=1

case "$1" in
start)
	if [ "0$OWL_STARTUP_VERSION" -ge 3 ]; then
		daemon --expect-user ntpd -- ntpd -s
	else
		daemon ntpd -s
	fi
	;;
stop)
	if [ "0$OWL_STARTUP_VERSION" -ge 3 ]; then
		# owl-startup 0.24 compatible -- (GM)
		killproc --expect-user ntpd ntpd
	else
		killproc ntpd
	fi
	;;
reload)
	if [ "0$OWL_STARTUP_VERSION" -ge 3 ]; then
		killproc --expect-user ntpd -HUP ntpd
	else
		killproc -HUP ntpd
	fi
	;;
status)
	if [ "0$OWL_STARTUP_VERSION" -ge 3 ]; then
		status --expect-user ntpd -- ntpd
	fi
	;;
restart)
	$0 stop
	$0 start
	;;
*)
	echo "Usage: ntpd {start|stop|status|reload|restart}"
	exit 1
esac

exit $?
