#!/bin/sh
#
# Start xntpd
#

if [ ! -d /opt/arch  -o ! -f /etc/ntp.conf ]
then			# /opt not mounted
	exit
fi
case "$1" in
'start')
		echo starting xntpd.
		servers=`awk '/server/ { print $2 }' /etc/ntp.conf`
		/opt/etc/ntpdate -v $servers
		(
		sleep 10
		/opt/etc/xntpd
		) &
		;;
'stop')
		fuser -k /opt/etc/xntpd
		;;

*)
	echo "Usage: /etc/init.d/xntpd { start | stop }"
	;;
esac
