From 06a05223b5faea3491298aef5716b7c88d22791f Mon Sep 17 00:00:00 2001 From: Danil Titarenko <77471369+danilapog@users.noreply.github.com> Date: Tue, 19 Jul 2022 15:51:46 +0300 Subject: [PATCH] Fix bug #58032 / Fix moves certificates alarm messages (#461) * Add some checks before replace certificates * Change if check key * Refactoring code * Refactoring code * Add checking exist files * Refactor: refactoring code * Remove check files conditions --- run-document-server.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/run-document-server.sh b/run-document-server.sh index 0ae0764..cfba7a0 100755 --- a/run-document-server.sh +++ b/run-document-server.sh @@ -39,9 +39,11 @@ fi SSL_CERTIFICATES_DIR="/usr/share/ca-certificates/ds" mkdir -p ${SSL_CERTIFICATES_DIR} -cp -f ${DATA_DIR}/certs/* ${SSL_CERTIFICATES_DIR} -chmod 644 ${SSL_CERTIFICATES_DIR}/*.crt ${SSL_CERTIFICATES_DIR}/*.pem -chmod 400 ${SSL_CERTIFICATES_DIR}/*.key +if [[ -d ${DATA_DIR}/certs ]] && [ -e ${DATA_DIR}/certs/*.crt ]; then + cp -f ${DATA_DIR}/certs/* ${SSL_CERTIFICATES_DIR} + chmod 644 ${SSL_CERTIFICATES_DIR}/*.crt ${SSL_CERTIFICATES_DIR}/*.pem + chmod 400 ${SSL_CERTIFICATES_DIR}/*.key +fi if [[ -z $SSL_CERTIFICATE_PATH ]] && [[ -f ${SSL_CERTIFICATES_DIR}/${COMPANY_NAME}.crt ]]; then SSL_CERTIFICATE_PATH=${SSL_CERTIFICATES_DIR}/${COMPANY_NAME}.crt