From b847843ea76d0824cfb6c9116cafe0661268a3fc Mon Sep 17 00:00:00 2001 From: Christoph Date: Wed, 21 Jun 2023 15:13:12 +0200 Subject: [PATCH] install_httpd-2.4.sh: fix minor error in decting the patch level of OpenSSL version. --- install_httpd-2.4.sh | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/install_httpd-2.4.sh b/install_httpd-2.4.sh index 3cf1e44..c78a710 100755 --- a/install_httpd-2.4.sh +++ b/install_httpd-2.4.sh @@ -248,6 +248,22 @@ echo_skipped() { echo -e "\033[75G[ \033[33m\033[1mskipped\033[m ]" } +get_openssl_version() { + + OPENSSL_VERSION="$(openssl version|awk '{print $2}' | grep -o -E "[0-9]+\.[0-9]+\.[0-9]+[a-zA-Z]?")" + + OPENSSL_MAIN_VERSION=`echo $OPENSSL_VERSION | cut -d '.' -f1,2` + OPENSSL_MAJOR_VERSION=`echo $OPENSSL_VERSION | cut -d '.' -f1` + OPENSSL_MINOR_VERSION=`echo $OPENSSL_VERSION | cut -d '.' -f2` + OPENSSL_PATCH_LEVEL=`echo $OPENSSL_VERSION | cut -d '.' -f3` + + if [[ -n "${OPENSSL_VERSION}" ]] ; then + return 0 + else + return 1 + fi +} + detect_os_1 () { if $(which lsb_release > /dev/null 2>&1) ; then @@ -2310,7 +2326,8 @@ else fi echo "" >> ${_logdir}/main.log -if [[ "$os_dist" = "debian" ]] && [[ $os_version -gt 11 ]]; then + +if [[ ${OPENSSL_MAJOR_VERSION} -gt 1 ]]; then if [[ -f "${_srcdir}/dhparam-openssl-3.0-4096.pem" ]] ; then echo "## - Copy dhparam.pem to '$PREFIX/conf/ssl/dhparam.pem'.." >> ${_logdir}/main.log @@ -2328,7 +2345,7 @@ if [[ "$os_dist" = "debian" ]] && [[ $os_version -gt 11 ]]; then echo "## - Generate a dhparam.pem file .." >> ${_logdir}/main.log echo "## -" >> ${_logdir}/main.log echo "openssl dhparam -out $PREFIX/conf/ssl/dhparam.pem 4096" >> ${_logdir}/main.log - echononl "\tGenerate a dhparam.pem file.." + echononl "\tGenerate a dhparam.pem file - \033[5m\033[1mmay take a lon time\033[m.." openssl dhparam -out $PREFIX/conf/ssl/dhparam.pem 4096 >> ${_logdir}/main.log 2>&1 if [[ $? -eq 0 ]];then echo_ok