summaryrefslogtreecommitdiffstats
path: root/etc/periodic
diff options
context:
space:
mode:
authormaxim <maxim@FreeBSD.org>2007-05-13 09:33:35 +0000
committermaxim <maxim@FreeBSD.org>2007-05-13 09:33:35 +0000
commitdd0b82335199bca1e13baea68b229c4bfd11b65a (patch)
treeeb23f7e19f4254092528b65e2eec6e15de2396f2 /etc/periodic
parent438ef2cbb828e6a2eb605da1de32e57e41bf7b45 (diff)
downloadFreeBSD-src-dd0b82335199bca1e13baea68b229c4bfd11b65a.zip
FreeBSD-src-dd0b82335199bca1e13baea68b229c4bfd11b65a.tar.gz
o Add a script to check ntpd(8) state. Default is off.
PR: conf/112604 Submitted by: Oliver Fromme MFC after: 1 month
Diffstat (limited to 'etc/periodic')
-rw-r--r--etc/periodic/daily/480.status-ntpd28
1 files changed, 28 insertions, 0 deletions
diff --git a/etc/periodic/daily/480.status-ntpd b/etc/periodic/daily/480.status-ntpd
new file mode 100644
index 0000000..1eb8011
--- /dev/null
+++ b/etc/periodic/daily/480.status-ntpd
@@ -0,0 +1,28 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+# If there is a global system configuration file, suck it in.
+#
+if [ -r /etc/defaults/periodic.conf ]
+then
+ . /etc/defaults/periodic.conf
+ source_periodic_confs
+fi
+
+rc=0
+
+case "$daily_status_ntpd_enable" in
+ [Yy][Ee][Ss])
+ echo ""
+ echo "NTP status:"
+
+ synchronized=$(ntpq -p | tee /dev/stderr | grep '^\*')
+ if [ -z "$synchronized" ]; then
+ rc=1
+ fi
+ ;;
+esac
+
+exit $rc
OpenPOWER on IntegriCloud