Add a periodic script for daily status.
Submitted by: Alexander Milanov <a@amilanov.com>
This commit is contained in:
parent
47e6b8a80b
commit
b9a868dd23
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=442957
@ -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>
|
||||
|
||||
|
27
net/openntpd/files/480.status-openntpd.in
Normal file
27
net/openntpd/files/480.status-openntpd.in
Normal file
@ -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
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user