From 748e47b70b45fbc115ee4a02ac8a8d476f0af0b0 Mon Sep 17 00:00:00 2001 From: Christoph Date: Mon, 30 Oct 2023 18:59:06 +0100 Subject: [PATCH] install_nginx.sh: directory '/etc/nginx/ssl' was not created on a fresh install at debian 12. --- install_nginx.sh | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/install_nginx.sh b/install_nginx.sh index a9024c3..b01fd47 100755 --- a/install_nginx.sh +++ b/install_nginx.sh @@ -254,6 +254,19 @@ done blank_line +echononl "Create directory \"/etc/nginx/ssl\".." +if [[ ! -d "/etc/nginx/ssl" ]] ; then + mkdir "/etc/nginx/ssl" > ${log_file} 2>&1 + if [[ $? -ne 0 ]] ; then + echo_failed + error "$(cat $log_file)" + else + echo_ok + fi +else + echo_skipped +fi + _failed=false if [[ ${OPENSSL_MAJOR_VERSION} -gt 1 ]]; then echononl "Generate a dhparam.pem file - \033[5m\033[1mmay take a lon time\033[m .." @@ -269,17 +282,8 @@ elif [[ -f "/etc/nginx/ssl/dhparam.pem" ]]; then echo_skipped else echononl "Generate a dhparam.pem file with parameter '-dsaparam'.." - if [[ ! -d "/etc/nginx/ssl" ]] ; then - mkdir /etc/nginx/ssl > ${log_file} 2>&1 - if [[ $? -ne 0 ]] ; then - _failed=true - fi - fi openssl dhparam -dsaparam -out /etc/nginx/ssl/dhparam.pem 2048 >> ${log_file} 2>&1 if [[ $? -ne 0 ]] ; then - _failed=true - fi - if $_failed ; then echo_failed error "$(cat $log_file)" else