summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornaddy <naddy@FreeBSD.org>2017-06-08 20:29:22 +0000
committernaddy <naddy@FreeBSD.org>2017-06-08 20:29:22 +0000
commitb612dddcced603dce0e92f2730704ec86d9331b4 (patch)
treeaeadfd7a852fc1b067e9eccd5404cbd1ed58adfe
parent5596b9e212a3445a92a04f7e1d96f13436900362 (diff)
downloadFreeBSD-ports-b612dddcced603dce0e92f2730704ec86d9331b4.zip
FreeBSD-ports-b612dddcced603dce0e92f2730704ec86d9331b4.tar.gz
Add a periodic script for daily status.
Submitted by: Alexander Milanov <a@amilanov.com>
-rw-r--r--net/openntpd/Makefile7
-rw-r--r--net/openntpd/files/480.status-openntpd.in27
-rw-r--r--net/openntpd/pkg-plist1
3 files changed, 34 insertions, 1 deletions
diff --git a/net/openntpd/Makefile b/net/openntpd/Makefile
index 9dc8c7c..8a0d504 100644
--- a/net/openntpd/Makefile
+++ b/net/openntpd/Makefile
@@ -2,7 +2,7 @@
PORTNAME= openntpd
PORTVERSION= 6.0p1
-PORTREVISION= 6
+PORTREVISION= 7
PORTEPOCH= 2
CATEGORIES= net
MASTER_SITES= OPENBSD/OpenNTPD
@@ -23,12 +23,17 @@ USES= ssl
GNU_CONFIGURE= yes
CONFIGURE_ARGS= --with-cacert=${LOCALBASE}/etc/ssl/cert.pem
+SUB_FILES= 480.status-openntpd
+
pre-build:
${REINPLACE_CMD} -e 's,%%PREFIX%%,${PREFIX},g' \
${WRKSRC}/src/ntpd.conf.5 ${WRKSRC}/src/ntpd.8
post-install:
cd ${STAGEDIR}${PREFIX}/etc && ${MV} ntpd.conf ntpd.conf.sample
+ ${MKDIR} ${STAGEDIR}${PREFIX}/etc/periodic/daily
+ ${INSTALL_SCRIPT} ${WRKDIR}/480.status-openntpd \
+ ${STAGEDIR}${PREFIX}/etc/periodic/daily
.include <bsd.port.pre.mk>
diff --git a/net/openntpd/files/480.status-openntpd.in b/net/openntpd/files/480.status-openntpd.in
new file mode 100644
index 0000000..1a3d8eb
--- /dev/null
+++ b/net/openntpd/files/480.status-openntpd.in
@@ -0,0 +1,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
diff --git a/net/openntpd/pkg-plist b/net/openntpd/pkg-plist
index ca20283..3b115a1 100644
--- a/net/openntpd/pkg-plist
+++ b/net/openntpd/pkg-plist
@@ -1,4 +1,5 @@
@sample etc/ntpd.conf.sample
+etc/periodic/daily/480.status-openntpd
man/man5/ntpd.conf.5.gz
man/man8/ntpctl.8.gz
man/man8/ntpd.8.gz
OpenPOWER on IntegriCloud