install_httpd-2.4.sh: fix minor error in decting the patch level of OpenSSL version.

This commit is contained in:
Christoph 2023-06-21 15:13:12 +02:00
parent 2d796ce216
commit b847843ea7

View File

@ -248,6 +248,22 @@ echo_skipped() {
echo -e "\033[75G[ \033[33m\033[1mskipped\033[m ]" 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 () { detect_os_1 () {
if $(which lsb_release > /dev/null 2>&1) ; then if $(which lsb_release > /dev/null 2>&1) ; then
@ -2310,7 +2326,8 @@ else
fi fi
echo "" >> ${_logdir}/main.log 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 if [[ -f "${_srcdir}/dhparam-openssl-3.0-4096.pem" ]] ; then
echo "## - Copy dhparam.pem to '$PREFIX/conf/ssl/dhparam.pem'.." >> ${_logdir}/main.log 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 "## - Generate a dhparam.pem file .." >> ${_logdir}/main.log
echo "## -" >> ${_logdir}/main.log echo "## -" >> ${_logdir}/main.log
echo "openssl dhparam -out $PREFIX/conf/ssl/dhparam.pem 4096" >> ${_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 openssl dhparam -out $PREFIX/conf/ssl/dhparam.pem 4096 >> ${_logdir}/main.log 2>&1
if [[ $? -eq 0 ]];then if [[ $? -eq 0 ]];then
echo_ok echo_ok