The script was rsync old to overwrite new pem files. now it's fix use acme.sh generated pem overwrites to other folders.
parent
d67a2d8890
commit
114035e563
|
@ -79,23 +79,19 @@ In DSM control panel, open the 'Task Scheduler' and create a new scheduled task
|
||||||
* Task setting: User-defined-script:
|
* 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!
|
# do not change anything beyond this line!
|
||||||
|
|
||||||
CERTROOTDIR="/usr/syno/etc/certificate"
|
CERTROOTDIR="/usr/syno/etc/certificate"
|
||||||
|
#CERTROOTDIR="/usr/syno/etc/certificate/system/default/"
|
||||||
PACKAGECERTROOTDIR="/usr/local/etc/certificate"
|
PACKAGECERTROOTDIR="/usr/local/etc/certificate"
|
||||||
FULLCERTDIR="$CERTROOTDIR/_archive/$CERTDIR"
|
FULLCERTDIR="$CERTROOTDIR/system/default"
|
||||||
|
|
||||||
# find all subdirectories containing cert.pem files
|
# find all subdirectories containing cert.pem files
|
||||||
PEMFILES=$(find $CERTROOTDIR -name cert.pem)
|
PEMFILES=$(find $CERTROOTDIR -name cert.pem)
|
||||||
if [ ! -z "$PEMFILES" ]; then
|
if [ ! -z "$PEMFILES" ]; then
|
||||||
for DIR in $PEMFILES; do
|
for DIR in $PEMFILES; do
|
||||||
# replace all certificates, but not the ones in the _archive folder
|
# replace all certificates, but not the ones in the default folder
|
||||||
if [[ $DIR != *"/_archive/"* ]]; then
|
if [[ $DIR != *"/default/"* ]]; then
|
||||||
rsync -avh "$FULLCERTDIR/" "$(dirname $DIR)/"
|
rsync -avh "$FULLCERTDIR/" "$(dirname $DIR)/"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
Loading…
Reference in New Issue