From 607b11ab6b66b391fb59f125dc7acace437c0a72 Mon Sep 17 00:00:00 2001 From: Aubrey Hewes Date: Fri, 24 Jul 2020 21:18:07 +0200 Subject: [PATCH] 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 --- plugins/certs/subcommands/add | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/certs/subcommands/add b/plugins/certs/subcommands/add index b86ba2f10..a52b56621 100755 --- a/plugins/certs/subcommands/add +++ b/plugins/certs/subcommands/add @@ -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"