View | Details | Raw Unified | Return to bug 221043 | Differences between
and this patch

Collapse All | Expand All

(-)Makefile (+8 lines)
Lines 3-8 Link Here
3
3
4
PORTNAME=	certbot
4
PORTNAME=	certbot
5
PORTVERSION=	${ACME_VERSION}
5
PORTVERSION=	${ACME_VERSION}
6
PORTREVISION=	1
6
PORTEPOCH=	1
7
PORTEPOCH=	1
7
CATEGORIES=	security python
8
CATEGORIES=	security python
8
MASTER_SITES=	CHEESESHOP
9
MASTER_SITES=	CHEESESHOP
Lines 33-42 Link Here
33
USE_PYTHON=	autoplist concurrent distutils
34
USE_PYTHON=	autoplist concurrent distutils
34
35
35
NO_ARCH=	yes
36
NO_ARCH=	yes
37
SUB_FILES=	500.certbot
38
PLIST_FILES=	etc/periodic/weekly/500.certbot
36
39
37
post-patch:
40
post-patch:
38
	@${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|' ${WRKSRC}/certbot/compat.py
41
	@${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|' ${WRKSRC}/certbot/compat.py
39
42
43
post-install:
44
	${MKDIR} ${STAGEDIR}${PREFIX}/etc/periodic/weekly
45
	${INSTALL_SCRIPT} ${WRKDIR}/500.certbot \
46
		${STAGEDIR}${PREFIX}/etc/periodic/weekly
47
40
do-test:
48
do-test:
41
	@cd ${WRKSRC} && ${PYTHON_CMD} ${PYDISTUTILS_SETUP} test
49
	@cd ${WRKSRC} && ${PYTHON_CMD} ${PYDISTUTILS_SETUP} test
42
50
(-)files/500.certbot.in (+51 lines)
Line 0 Link Here
1
#!/bin/sh
2
#
3
# $FreeBSD$
4
#
5
# Automatically renew Let's Encrypt certificates each month
6
#
7
# Add the following lines to /etc/periodic.conf:
8
#
9
# weekly_certbot_enable (bool):	Set to "NO" by default
10
# weekly_certbot_service (str):	If defined, certbot will try to
11
#					shutdown this this service before
12
#					renewing the certificate, and restart
13
#					it afterwards.  For example, set to
14
#					"nginx" or "apache24"
15
16
# If there is a global system configuration file, suck it in.
17
#
18
if [ -r /etc/defaults/periodic.conf ]
19
then
20
    . /etc/defaults/periodic.conf
21
    source_periodic_confs
22
fi
23
24
echo "running certbot? "
25
case "$weekly_certbot_enable" in
26
    [Yy][Ee][Ss])
27
	PRE_HOOK=""
28
	POST_HOOK=""
29
	if [ -n "$weekly_certbot_service" ]
30
	then
31
	    if service "$weekly_certbot_service" onestatus
32
	    then
33
		PRE_HOOK="service $weekly_certbot_service onestop"
34
		POST_HOOK="service $weekly_certbot_service onestart"
35
	    fi
36
	fi
37
38
	anticongestion
39
	if %%LOCALBASE%%/bin/certbot renew --pre-hook "$PRE_HOOK" \
40
	                             --post-hook "$POST_HOOK" \
41
	   			     --no-random-sleep-on-renew
42
	then
43
	    rc=0
44
	else
45
	    rc=1
46
	fi
47
	;;
48
    *)  rc=0;;
49
esac
50
51
exit $rc

Return to bug 221043