From 49069bb0f25594eec7a0d4c1c993afb73d8ce961 Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Thu, 3 Oct 2019 18:04:34 +0800 Subject: web: Employ monthly periodic task to renew certificates --- roles/web/files/600.acme-sh | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 roles/web/files/600.acme-sh (limited to 'roles/web/files') diff --git a/roles/web/files/600.acme-sh b/roles/web/files/600.acme-sh new file mode 100644 index 0000000..fdf4cc4 --- /dev/null +++ b/roles/web/files/600.acme-sh @@ -0,0 +1,27 @@ +#!/bin/sh +# +# Monthly task to renew and deploy acme certificates. + +if [ -r /etc/defaults/periodic.conf ]; then + . /etc/defaults/periodic.conf + source_periodic_confs +fi + +export PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin + +case "$monthly_acme_sh_enable" in + [Yy][Ee][Ss]) + echo + echo "Checking Let's Encrypt certificates:" + if [ -x "$monthly_acme_sh_renewscript" ]; then + echo "Renewing certificates ..." + $monthly_acme_sh_renewscript + if [ -x "$monthly_acme_sh_deployscript" ]; then + echo "Deploying certificates ..." + $monthly_acme_sh_deployscript + fi + fi + ;; + *) + ;; +esac -- cgit v1.2.2