svn commit: r442957 - in head/net/openntpd: . files
Christian Weisgerber
naddy at FreeBSD.org
Thu Jun 8 20:29:23 UTC 2017
Author: naddy
Date: Thu Jun 8 20:29:22 2017
New Revision: 442957
URL: https://svnweb.freebsd.org/changeset/ports/442957
Log:
Add a periodic script for daily status.
Submitted by: Alexander Milanov <a at amilanov.com>
Added:
head/net/openntpd/files/480.status-openntpd.in (contents, props changed)
Modified:
head/net/openntpd/Makefile
head/net/openntpd/pkg-plist
Modified: head/net/openntpd/Makefile
==============================================================================
--- head/net/openntpd/Makefile Thu Jun 8 19:58:20 2017 (r442956)
+++ head/net/openntpd/Makefile Thu Jun 8 20:29:22 2017 (r442957)
@@ -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>
Added: head/net/openntpd/files/480.status-openntpd.in
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/net/openntpd/files/480.status-openntpd.in Thu Jun 8 20:29:22 2017 (r442957)
@@ -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
Modified: head/net/openntpd/pkg-plist
==============================================================================
--- head/net/openntpd/pkg-plist Thu Jun 8 19:58:20 2017 (r442956)
+++ head/net/openntpd/pkg-plist Thu Jun 8 20:29:22 2017 (r442957)
@@ -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
More information about the svn-ports-all
mailing list