xref: /freebsd/contrib/ntp/html/hints/solaris.xtra.S99ntpd (revision 416ba5c74546f32a993436a99516d35008e9f384)
1*2b15cb3dSCy Schubert#!/bin/sh
2*2b15cb3dSCy Schubertif [ $1 = "start" ]; then
3*2b15cb3dSCy Schubert        if [ -x /usr/local/bin/xntpd ]; then
4*2b15cb3dSCy Schubert                echo "Starting NTP daemon, takes about 1 minute... "
5*2b15cb3dSCy Schubert		# dosynctodr may need to be left alone as of with Solaris 2.6
6*2b15cb3dSCy Schubert		# The following line is unnecessary if you turn off
7*2b15cb3dSCy Schubert		# dosynctodr in /etc/system.
8*2b15cb3dSCy Schubert                /usr/local/bin/tickadj -s
9*2b15cb3dSCy Schubert                /usr/local/bin/ntpdate -v server1 server2
10*2b15cb3dSCy Schubert                sleep 5
11*2b15cb3dSCy Schubert                /usr/local/bin/xntpd
12*2b15cb3dSCy Schubert        fi
13*2b15cb3dSCy Schubertelse
14*2b15cb3dSCy Schubert        if [ $1 = "stop" ]; then
15*2b15cb3dSCy Schubert                pid=`/usr/bin/ps -e | /usr/bin/grep xntpd | /usr/bin/sed -e 's/^  *//' -e 's/ .*//'`
16*2b15cb3dSCy Schubert                if [ "${pid}" != "" ]; then
17*2b15cb3dSCy Schubert                        echo "Stopping Network Time Protocol daemon "
18*2b15cb3dSCy Schubert                        /usr/bin/kill ${pid}
19*2b15cb3dSCy Schubert                fi
20*2b15cb3dSCy Schubert        fi
21*2b15cb3dSCy Schubertfi
22