Skip to content

Commit 9b935a0

Browse files
committed
style: coherent coding style on check_dh_group
+ removal of an unneeded local keyword
1 parent e0aaa93 commit 9b935a0

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

app/entrypoint.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ function check_dh_group {
5858
fi
5959

6060
# 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
6262
echo "Error: Unsupported DHPARAM_BITS size: ${DHPARAM_BITS}. Supported values are 2048, 3072, or 4096 (default)." >&2
6363
exit 1
6464
fi
@@ -68,7 +68,7 @@ function check_dh_group {
6868
local EXPECTED_DHPARAM_HASH; EXPECTED_DHPARAM_HASH=$(sha256sum "$RFC7919_DHPARAM_FILE" | cut -d ' ' -f1)
6969

7070
# DH params may be provided by the user (rarely necessary)
71-
if [[ -f ${DHPARAM_FILE} ]]; then
71+
if [[ -f "$DHPARAM_FILE" ]]; then
7272
local USER_PROVIDED_DH
7373

7474
# Check if the DH params file is user provided or comes from acme-companion
@@ -78,7 +78,7 @@ function check_dh_group {
7878
local FFDHE_HASH; FFDHE_HASH=$(sha256sum "$f" | cut -d ' ' -f1)
7979
if [[ "$DHPARAM_HASH" == "$FFDHE_HASH" ]]; then
8080
# This is an acme-companion created DH params file
81-
local USER_PROVIDED_DH='false'
81+
USER_PROVIDED_DH='false'
8282

8383
# Check if /etc/nginx/certs/dhparam.pem matches the expected pre-generated DH group
8484
if [[ "$DHPARAM_HASH" == "$EXPECTED_DHPARAM_HASH" ]]; then
@@ -89,7 +89,7 @@ function check_dh_group {
8989
fi
9090
done
9191

92-
if parse_true ${USER_PROVIDED_DH:=true}; then
92+
if parse_true "${USER_PROVIDED_DH:=true}"; then
9393
# This is a user provided DH params file
9494
set_ownership_and_permissions "$DHPARAM_FILE"
9595
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 {
100100
# The RFC7919 DH params file either need to be created or replaced
101101
echo "Info: Setting up ${DHPARAM_BITS} bits RFC7919 Diffie-Hellman group..."
102102
cp "$RFC7919_DHPARAM_FILE" "${DHPARAM_FILE}.tmp"
103-
mv "${DHPARAM_FILE}.tmp" "${DHPARAM_FILE}"
103+
mv "${DHPARAM_FILE}.tmp" "$DHPARAM_FILE"
104104
set_ownership_and_permissions "$DHPARAM_FILE"
105105
}
106106

0 commit comments

Comments
 (0)