File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / ntp / scripts / rc1 / xntp
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Tue May 29 12:08:38 2012 UTC (12 years, 2 months ago) by misho
Branches: ntp, MAIN
CVS tags: v4_2_6p5p0, v4_2_6p5, HEAD
ntp 4.2.6p5

#!/bin/sh

killproc() {	# kill named processes
	pid=`/usr/bin/ps -e |
		/usr/bin/grep $1 |
		/usr/bin/sed -e 's/^  *//' -e 's/ .*//'`
	[ "$pid" != "" ] && kill $pid
}

case "$1" in
'start')
	ps -e | grep xntpd > /dev/null 2>&1
	if [ $? -eq 0 ]
	then
		echo "ntp daemon already running. ntp start aborted"
		exit 0
	fi
	if [ -f /etc/inet/ntp.conf -a -x /usr/sbin/xntpd ]
	then
		/usr/sbin/xntpd -c /etc/inet/ntp.conf
	fi
	;;
'stop')
	killproc xntpd
	;;
*)
	echo "Usage: /etc/init.d/xntp { start | stop }"
	;;
esac

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>