summaryrefslogtreecommitdiffstats
path: root/contrib/ntp/scripts/rc1/xntp
blob: 227b943aaa2ef6dfbe57c724ac48a7e4bb000b7e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/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
OpenPOWER on IntegriCloud