Index: security/py-certbot/Makefile =================================================================== --- security/py-certbot/Makefile (revision 449150) +++ security/py-certbot/Makefile (working copy) @@ -3,6 +3,7 @@ PORTNAME= certbot PORTVERSION= 0.17.0 +PORTREVISION= 1 PORTEPOCH= 1 CATEGORIES= security python MASTER_SITES= CHEESESHOP @@ -28,6 +29,8 @@ ${PYTHON_PKGNAMEPREFIX}zope.interface>0:devel/py-zope.interface TEST_DEPENDS= ${PYTHON_PKGNAMEPREFIX}mock>0:devel/py-mock +SUB_FILES= 500.certbot + # Actually 2.7,3.3+ USES= python USE_PYTHON= autoplist concurrent distutils @@ -34,11 +37,19 @@ NO_ARCH= yes +PLIST_FILES= etc/periodic/monthly/500.certbot + post-patch: @${REINPLACE_CMD} \ -e 's|/etc/|${LOCALBASE}/etc/|' \ -e 's|/var/lib|/var/db|' \ ${WRKSRC}/${PORTNAME}/constants.py + +post-install: + ${MKDIR} ${STAGEDIR}${PREFIX}/etc/periodic/monthly + ${INSTALL_SCRIPT} ${WRKDIR}/500.certbot \ + ${STAGEDIR}${PREFIX}/etc/periodic/monthly + do-test: @cd ${WRKSRC} && ${PYTHON_CMD} ${PYDISTUTILS_SETUP} test Index: security/py-certbot/files/500.certbot.in =================================================================== --- security/py-certbot/files/500.certbot.in (nonexistent) +++ security/py-certbot/files/500.certbot.in (working copy) @@ -0,0 +1,46 @@ +#!/bin/sh +# +# $FreeBSD$ +# +# Automatically renew Let's Encrypt certificates each month +# +# Add the following lines to /etc/periodic.conf: +# +# monthly_certbot_enable (bool): Set to "NO" by default +# monthly_certbot_service (str): If defined, certbot will try to +# shutdown this this service before +# renewing the certificate, and restart +# it afterwards. For example, set to +# "nginx" or "apache24" + +# 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 + +echo "running certbot? " +case "$monthly_certbot_enable" in + [Yy][Ee][Ss]) + PRE_HOOK="" + POST_HOOK="" + if [ -n "$monthly_certbot_service" ]; then + if service "$monthly_certbot_service" onestatus; then + PRE_HOOK="service $monthly_certbot_service onestop" + POST_HOOK="service $monthly_certbot_service onestart" + fi + fi + + if %%LOCALBASE%%/bin/certbot renew --pre-hook "$PRE_HOOK" \ + --post-hook "$POST_HOOK"; then + rc=0 + else + rc=1 + fi + ;; + *) rc=0;; +esac + +exit $rc Property changes on: security/py-certbot/files/500.certbot.in ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property