Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/nextcloudpi.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
authornachoparker <nacho@ownyourbits.com>2021-10-13 02:55:45 +0300
committernachoparker <nacho@ownyourbits.com>2021-10-14 20:08:05 +0300
commit35a3a54845fd2d80cb2b0843f711b85e0690cbe0 (patch)
tree60e4c229d1a5ef281da10fd623dadc0db0d2e42a /etc
parent9bddfad8057c713c2698e768c855348498438dda (diff)
letsencrypt: favor most recent cert if there are manyv1.40.9
Signed-off-by: nachoparker <nacho@ownyourbits.com>
Diffstat (limited to 'etc')
-rw-r--r--etc/ncp-templates/nextcloud.conf.sh6
1 files changed, 4 insertions, 2 deletions
diff --git a/etc/ncp-templates/nextcloud.conf.sh b/etc/ncp-templates/nextcloud.conf.sh
index ea49032c..ec0b3174 100644
--- a/etc/ncp-templates/nextcloud.conf.sh
+++ b/etc/ncp-templates/nextcloud.conf.sh
@@ -42,8 +42,10 @@ EOF
if [[ "$1" != "--defaults" ]] && [[ -n "$LETSENCRYPT_DOMAIN" ]]; then
echo " ServerName ${LETSENCRYPT_DOMAIN}"
LETSENCRYPT_CERT_BASE_PATH="/etc/letsencrypt/live/${LETSENCRYPT_DOMAIN,,}"
- [[ -d "${LETSENCRYPT_CERT_BASE_PATH}" ]] || \
- LETSENCRYPT_CERT_BASE_PATH="$(find /etc/letsencrypt/live -name "${LETSENCRYPT_DOMAIN,,}*" | head -1)"
+ [[ -d "${LETSENCRYPT_CERT_BASE_PATH}" ]] || {
+ #find the most recent cert
+ LETSENCRYPT_CERT_BASE_PATH="$(find /etc/letsencrypt/live -type d -name "${LETSENCRYPT_DOMAIN,,}*" -printf "%T@ %p\n" | sort -n | cut -f2 -d' ' | tail -1)"
+ }
LETSENCRYPT_CERT_PATH="${LETSENCRYPT_CERT_BASE_PATH}/fullchain.pem"
LETSENCRYPT_KEY_PATH="${LETSENCRYPT_CERT_BASE_PATH}/privkey.pem"