summaryrefslogtreecommitdiff
path: root/chrony/chronyd
blob: 53f1e9e86cbf58880455de6f44927aeae46b2fdc (plain)
    1 #!/bin/sh
    2 #
    3 # /etc/rc.d/chronyd: start/stop the chrony time server
    4 #
    5 
    6 KEY=`sed -n "s/^commandkey *//p" /etc/chrony.conf`
    7 PASSWD=`sed -n "s/^$KEY *//p" /etc/chrony.keys`
    8 
    9 case $1 in
   10 start)
   11 	/usr/sbin/chronyd -s -r
   12 	;;
   13 stop)
   14 	killall -q  /usr/sbin/chronyd
   15 	;;
   16 restart)
   17 	$0 stop
   18 	sleep 2
   19 	$0 start
   20 	;;
   21 online)
   22 	/usr/bin/chronyc << EOF > /dev/null
   23 	password $PASSWD
   24 	online
   25 EOF
   26 	;;
   27 offline)
   28 	/usr/bin/chronyc << EOF > /dev/null
   29 	password $PASSWD
   30 	offline
   31 	dump
   32 	writertc
   33 EOF
   34 	;;
   35 *)
   36 	echo "usage: $0 [start|stop|restart|online|offline]"
   37 	;;
   38 esac
   39 
   40 # End of file

Generated by cgit