Skip to content

Commit d590102

Browse files
committed
refactor: DNS-01 variables are scoped to the function
1 parent d0d37ae commit d590102

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

app/letsencrypt_service

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ function update_cert {
198198
[[ "$key" == "DNS_API" ]] && continue
199199
dns_api_keys+=("$key")
200200
local value="${acmesh_dns_config[$key]}"
201-
declare -x "$key"="$value"
201+
local -x "$key"="$value"
202202
done
203203

204204
echo "Info: DNS challenge using $acmesh_dns_api DNS API with the following keys: ${dns_api_keys[*]}"
@@ -420,16 +420,6 @@ function update_cert {
420420

421421
local acmesh_return=$?
422422

423-
# DNS challenge: clean environment variables
424-
if [[ "$acme_challenge" == "DNS-01" ]]; then
425-
local -n acmesh_dns_config="ACMESH_${cid}_DNS_API_CONFIG"
426-
# Loop over defined variable for acme.sh DNS api config
427-
for key in "${!acmesh_dns_config[@]}"; do
428-
[[ "$key" == "DNS_API" ]] && continue
429-
unset "$key"
430-
done
431-
fi
432-
433423
# 0 = success, 2 = RENEW_SKIP
434424
if [[ $acmesh_return == 0 || $acmesh_return == 2 ]]; then
435425
for domain in "${hosts_array[@]}"; do

0 commit comments

Comments
 (0)