summaryrefslogtreecommitdiff
path: root/net/openntpd/files/480.status-openntpd.in
blob: 1a3d8eb3ce2c6c3931993b754950c878825fde6f (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
#!/bin/sh
#
# $FreeBSD$
#

if [ -r /etc/defaults/periodic.conf ] ; then
    . /etc/defaults/periodic.conf
    source_periodic_confs
fi

ntpctl=%%PREFIX%%/sbin/ntpctl

rc=0

case "$daily_status_openntpd_enable" in
    [Yy][Ee][Ss])
	echo
	echo 'OpenNTPD status:'

	synced=$($ntpctl -s status | tee /dev/stderr | grep 'clock synced')
	if [ -z "$synced" ] ; then
		rc=1
	fi
	;;
esac

exit $rc