Skip to content

Commit 2d02780

Browse files
committed
Use '_mutable' functions for authentication variables
Fixes #6081.
1 parent 94a1633 commit 2d02780

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

dnsapi/dns_gandi_livedns.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ dns_gandi_livedns_add() {
2323
fulldomain=$1
2424
txtvalue=$2
2525

26+
GANDI_LIVEDNS_KEY="${GANDI_LIVEDNS_KEY:-$(_readaccountconf_mutable GANDI_LIVEDNS_KEY)}"
27+
GANDI_LIVEDNS_TOKEN="${GANDI_LIVEDNS_TOKEN:-$(_readaccountconf_mutable GANDI_LIVEDNS_TOKEN)}"
2628
if [ -z "$GANDI_LIVEDNS_KEY" ] && [ -z "$GANDI_LIVEDNS_TOKEN" ]; then
2729
_err "No Token or API key (deprecated) specified for Gandi LiveDNS."
2830
_err "Create your token or key and export it as GANDI_LIVEDNS_KEY or GANDI_LIVEDNS_TOKEN respectively"
@@ -31,11 +33,11 @@ dns_gandi_livedns_add() {
3133

3234
# Keep only one secret in configuration
3335
if [ -n "$GANDI_LIVEDNS_TOKEN" ]; then
34-
_saveaccountconf GANDI_LIVEDNS_TOKEN "$GANDI_LIVEDNS_TOKEN"
35-
_clearaccountconf GANDI_LIVEDNS_KEY
36+
_saveaccountconf_mutable GANDI_LIVEDNS_TOKEN "$GANDI_LIVEDNS_TOKEN"
37+
_clearaccountconf_mutable GANDI_LIVEDNS_KEY
3638
elif [ -n "$GANDI_LIVEDNS_KEY" ]; then
37-
_saveaccountconf GANDI_LIVEDNS_KEY "$GANDI_LIVEDNS_KEY"
38-
_clearaccountconf GANDI_LIVEDNS_TOKEN
39+
_saveaccountconf_mutable GANDI_LIVEDNS_KEY "$GANDI_LIVEDNS_KEY"
40+
_clearaccountconf_mutable GANDI_LIVEDNS_TOKEN
3941
fi
4042

4143
_debug "First detect the root zone"

0 commit comments

Comments
 (0)