ports/net/openntpd/files/480.status-openntpd.in
Christian Weisgerber b9a868dd23 Add a periodic script for daily status.
Submitted by:	Alexander Milanov <a@amilanov.com>
2017-06-08 20:29:22 +00:00

27 lines
390 B
Bash

#!/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