install_postfix_advanced.sh: fix error detecting os distribution/version.

This commit is contained in:
Christoph 2023-11-15 17:20:34 +01:00
parent bb464c1686
commit 2291f6efa9

View File

@ -2621,7 +2621,7 @@ fi
## -
echononl " Generate DH key length=512 \"/etc/postfix/ssl/dh_512.pem\""
if [[ ! -f /etc/postfix/ssl/dh_512.pem ]]; then
if [[ $DIST_VERSION -gt 11 ]] ; then
if [[ "$os_dist" = "debian" ]] && [[ $os_version -gt 11 ]] ; then
openssl dhparam -out /etc/postfix/ssl/dh_512.pem 512 > /dev/null 2>&1
else
openssl dhparam -dsaparam -out /etc/postfix/ssl/dh_512.pem 512 > /dev/null 2>&1
@ -2632,7 +2632,7 @@ if [[ ! -f /etc/postfix/ssl/dh_512.pem ]]; then
echo_failed
fi
else
if [[ $DIST_VERSION -gt 11 ]] ; then
if [[ "$os_dist" = "debian" ]] && [[ $os_version -gt 11 ]] ; then
if $(grep -q -E "X9.42" /etc/postfix/ssl/dh_512.pem 2> /dev/null); then
openssl dhparam -out /etc/postfix/ssl/dh_512.pem 512 > /dev/null 2>&1
if [[ $? -eq 0 ]] ; then
@ -2649,7 +2649,7 @@ else
fi
echononl " Generate DH key length=1024 \"/etc/postfix/ssl/dh_1024.pem\""
if [[ ! -f /etc/postfix/ssl/dh_1024.pem ]]; then
if [[ $DIST_VERSION -gt 11 ]] ; then
if [[ "$os_dist" = "debian" ]] && [[ $os_version -gt 11 ]] ; then
openssl dhparam -out /etc/postfix/ssl/dh_1024.pem 1024 > /dev/null 2>&1
else
openssl dhparam -dsaparam -out /etc/postfix/ssl/dh_1024.pem 1024 > /dev/null 2>&1
@ -2660,7 +2660,7 @@ if [[ ! -f /etc/postfix/ssl/dh_1024.pem ]]; then
echo_failed
fi
else
if [[ $DIST_VERSION -gt 11 ]] ; then
if [[ "$os_dist" = "debian" ]] && [[ $os_version -gt 11 ]] ; then
if $(grep -q -E "X9.42" /etc/postfix/ssl/dh_1024.pem 2> /dev/null); then
openssl dhparam -out /etc/postfix/ssl/dh_1024.pem 1024 > /dev/null 2>&1
if [[ $? -eq 0 ]] ; then
@ -2677,7 +2677,7 @@ else
fi
echononl " Generate DH key length=2048 \"/etc/postfix/ssl/dh_2048.pem\""
if [[ ! -f /etc/postfix/ssl/dh_2048.pem ]]; then
if [[ $DIST_VERSION -gt 11 ]] ; then
if [[ "$os_dist" = "debian" ]] && [[ $os_version -gt 11 ]] ; then
openssl dhparam -out /etc/postfix/ssl/dh_2048.pem 2048 > /dev/null 2>&1
else
openssl dhparam -dsaparam -out /etc/postfix/ssl/dh_2048.pem 2048 > /dev/null 2>&1
@ -2688,7 +2688,7 @@ if [[ ! -f /etc/postfix/ssl/dh_2048.pem ]]; then
echo_failed
fi
else
if [[ $DIST_VERSION -gt 11 ]] ; then
if [[ "$os_dist" = "debian" ]] && [[ $os_version -gt 11 ]] ; then
if $(grep -q -E "X9.42" /etc/postfix/ssl/dh_2048.pem 2> /dev/null); then
openssl dhparam -out /etc/postfix/ssl/dh_2048.pem 2048 > /dev/null 2>&1
if [[ $? -eq 0 ]] ; then