Browse Source

Support account id configuration for dnsimple

pull/3578/head
vin01 4 years ago
parent
commit
2abacb4029
No known key found for this signature in database GPG Key ID: 885C28C3B043329D
  1. 7
      dnsapi/dns_dnsimple.sh

7
dnsapi/dns_dnsimple.sh

@ -123,6 +123,10 @@ _get_root() {
# returns _account_id # returns _account_id
_get_account_id() { _get_account_id() {
_debug "retrive account id" _debug "retrive account id"
if [ -n "$DNSimple_ACCOUNT_ID" ]; then
_account_id="$DNSimple_ACCOUNT_ID"
else
if ! _dnsimple_rest GET "whoami"; then if ! _dnsimple_rest GET "whoami"; then
return 1 return 1
fi fi
@ -136,8 +140,9 @@ _get_account_id() {
_err "timeout retrieving account id" _err "timeout retrieving account id"
return 1 return 1
fi fi
_account_id=$(printf "%s" "$response" | _egrep_o "\"id\":[^,]*,\"email\":" | cut -d: -f2 | cut -d, -f1) _account_id=$(printf "%s" "$response" | _egrep_o "\"id\":[^,]*,\"email\":" | cut -d: -f2 | cut -d, -f1)
fi
_debug _account_id "$_account_id" _debug _account_id "$_account_id"
return 0 return 0

Loading…
Cancel
Save