fixed: when adding a cert remove previous cert before copying the new one

This fixes when a user (or plugin) has replaced the cert with a symlink; else the symlinked file would be overwritten.

This mainly is in the case of a global-cert (plugin) wildcard cert
This commit is contained in:
Aubrey Hewes
2020-07-24 21:18:07 +02:00
committed by Leopold Talirz
parent 57b317b0a4
commit 607b11ab6b

View File

@@ -71,6 +71,7 @@ cmd-certs-set() {
fi
mkdir -p "$APP_SSL_PATH"
rm -f "$APP_SSL_PATH/server.crt" "$APP_SSL_PATH/server.key"
cp "$CRT_FILE" "$APP_SSL_PATH/server.crt"
cp "$KEY_FILE" "$APP_SSL_PATH/server.key"
chmod 750 "$APP_SSL_PATH"