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
This commit is contained in:
Danil Titarenko 2022-07-19 15:51:46 +03:00 committed by GitHub
parent 143e77fdfc
commit 06a05223b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -39,9 +39,11 @@ fi
SSL_CERTIFICATES_DIR="/usr/share/ca-certificates/ds" SSL_CERTIFICATES_DIR="/usr/share/ca-certificates/ds"
mkdir -p ${SSL_CERTIFICATES_DIR} mkdir -p ${SSL_CERTIFICATES_DIR}
if [[ -d ${DATA_DIR}/certs ]] && [ -e ${DATA_DIR}/certs/*.crt ]; then
cp -f ${DATA_DIR}/certs/* ${SSL_CERTIFICATES_DIR} cp -f ${DATA_DIR}/certs/* ${SSL_CERTIFICATES_DIR}
chmod 644 ${SSL_CERTIFICATES_DIR}/*.crt ${SSL_CERTIFICATES_DIR}/*.pem chmod 644 ${SSL_CERTIFICATES_DIR}/*.crt ${SSL_CERTIFICATES_DIR}/*.pem
chmod 400 ${SSL_CERTIFICATES_DIR}/*.key chmod 400 ${SSL_CERTIFICATES_DIR}/*.key
fi
if [[ -z $SSL_CERTIFICATE_PATH ]] && [[ -f ${SSL_CERTIFICATES_DIR}/${COMPANY_NAME}.crt ]]; then if [[ -z $SSL_CERTIFICATE_PATH ]] && [[ -f ${SSL_CERTIFICATES_DIR}/${COMPANY_NAME}.crt ]]; then
SSL_CERTIFICATE_PATH=${SSL_CERTIFICATES_DIR}/${COMPANY_NAME}.crt SSL_CERTIFICATE_PATH=${SSL_CERTIFICATES_DIR}/${COMPANY_NAME}.crt