From 114035e563367484dbd25744092989195e2a7fd7 Mon Sep 17 00:00:00 2001 From: Jiang Sheng Date: Wed, 20 Jun 2018 13:38:50 +0800 Subject: [PATCH] The script was rsync old to overwrite new pem files. now it's fix use acme.sh generated pem overwrites to other folders. --- Synology-NAS-Guide.md | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/Synology-NAS-Guide.md b/Synology-NAS-Guide.md index cd6be44..8b45586 100644 --- a/Synology-NAS-Guide.md +++ b/Synology-NAS-Guide.md @@ -79,23 +79,19 @@ In DSM control panel, open the 'Task Scheduler' and create a new scheduled task * Task setting: User-defined-script: ``` -# Note: The $CERT_FOLDER must be hardcoded here since the running environment is unknown. Don't blindly copy&paste -# change this sample directory name "AsDFgH" to the name of your Let's Encrypt cert directory - -CERTDIR="AsDFgH" - # do not change anything beyond this line! CERTROOTDIR="/usr/syno/etc/certificate" +#CERTROOTDIR="/usr/syno/etc/certificate/system/default/" PACKAGECERTROOTDIR="/usr/local/etc/certificate" -FULLCERTDIR="$CERTROOTDIR/_archive/$CERTDIR" +FULLCERTDIR="$CERTROOTDIR/system/default" # find all subdirectories containing cert.pem files PEMFILES=$(find $CERTROOTDIR -name cert.pem) if [ ! -z "$PEMFILES" ]; then for DIR in $PEMFILES; do - # replace all certificates, but not the ones in the _archive folder - if [[ $DIR != *"/_archive/"* ]]; then + # replace all certificates, but not the ones in the default folder + if [[ $DIR != *"/default/"* ]]; then rsync -avh "$FULLCERTDIR/" "$(dirname $DIR)/" fi done