@@ -58,7 +58,7 @@ function check_dh_group {
58
58
fi
59
59
60
60
# Let's check DHPARAM_BITS is set to a supported value
61
- if [[ ! ${ DHPARAM_BITS} =~ ^(2048| 3072| 4096)$ ]]; then
61
+ if [[ ! " $ DHPARAM_BITS" =~ ^(2048| 3072| 4096)$ ]]; then
62
62
echo " Error: Unsupported DHPARAM_BITS size: ${DHPARAM_BITS} . Supported values are 2048, 3072, or 4096 (default)." >&2
63
63
exit 1
64
64
fi
@@ -68,7 +68,7 @@ function check_dh_group {
68
68
local EXPECTED_DHPARAM_HASH; EXPECTED_DHPARAM_HASH=$( sha256sum " $RFC7919_DHPARAM_FILE " | cut -d ' ' -f1)
69
69
70
70
# DH params may be provided by the user (rarely necessary)
71
- if [[ -f ${ DHPARAM_FILE} ]]; then
71
+ if [[ -f " $ DHPARAM_FILE" ]]; then
72
72
local USER_PROVIDED_DH
73
73
74
74
# Check if the DH params file is user provided or comes from acme-companion
@@ -78,7 +78,7 @@ function check_dh_group {
78
78
local FFDHE_HASH; FFDHE_HASH=$( sha256sum " $f " | cut -d ' ' -f1)
79
79
if [[ " $DHPARAM_HASH " == " $FFDHE_HASH " ]]; then
80
80
# This is an acme-companion created DH params file
81
- local USER_PROVIDED_DH=' false'
81
+ USER_PROVIDED_DH=' false'
82
82
83
83
# Check if /etc/nginx/certs/dhparam.pem matches the expected pre-generated DH group
84
84
if [[ " $DHPARAM_HASH " == " $EXPECTED_DHPARAM_HASH " ]]; then
@@ -89,7 +89,7 @@ function check_dh_group {
89
89
fi
90
90
done
91
91
92
- if parse_true ${USER_PROVIDED_DH:= true} ; then
92
+ if parse_true " ${USER_PROVIDED_DH:= true} " ; then
93
93
# This is a user provided DH params file
94
94
set_ownership_and_permissions " $DHPARAM_FILE "
95
95
echo " Info: A custom dhparam.pem file was provided. Best practice is to use standardized RFC7919 Diffie-Hellman groups instead."
@@ -100,7 +100,7 @@ function check_dh_group {
100
100
# The RFC7919 DH params file either need to be created or replaced
101
101
echo " Info: Setting up ${DHPARAM_BITS} bits RFC7919 Diffie-Hellman group..."
102
102
cp " $RFC7919_DHPARAM_FILE " " ${DHPARAM_FILE} .tmp"
103
- mv " ${DHPARAM_FILE} .tmp" " ${ DHPARAM_FILE} "
103
+ mv " ${DHPARAM_FILE} .tmp" " $DHPARAM_FILE "
104
104
set_ownership_and_permissions " $DHPARAM_FILE "
105
105
}
106
106
0 commit comments