xref: /freebsd/usr.sbin/periodic/etc/daily/480.status-ntpd (revision 95eb4b873b6a8b527c5bd78d7191975dfca38998)
1#!/bin/sh
2#
3#
4
5# If there is a global system configuration file, suck it in.
6#
7if [ -r /etc/defaults/periodic.conf ]
8then
9    . /etc/defaults/periodic.conf
10    source_periodic_confs
11fi
12
13rc=0
14
15case "$daily_status_ntpd_enable" in
16    [Yy][Ee][Ss])
17	echo ""
18	echo "NTP status:"
19
20	synchronized=$(ntpq -pn | tee /dev/stderr | grep '^\*')
21	if [ -z "$synchronized" ]; then
22		rc=1
23	fi
24	;;
25esac
26
27exit $rc
28