Browse Source

now passing all shellcheck checks

pull/2117/head
Steven Miano 7 years ago
parent
commit
9b55016904
No known key found for this signature in database GPG Key ID: 1811C2CB82194F52
  1. 8
      dnsapi/dns_ultra.sh

8
dnsapi/dns_ultra.sh

@ -24,7 +24,7 @@ dns_ultra_add(){
_saveaccountconf_mutable ULTRA_USR "$ULTRA_USR" _saveaccountconf_mutable ULTRA_USR "$ULTRA_USR"
_saveaccountconf_mutable ULTRA_PWD "$ULTRA_PWD" _saveaccountconf_mutable ULTRA_PWD "$ULTRA_PWD"
_debug "First detect the root zone" _debug "First detect the root zone"
if ! _get_root "${fulldomain}"; then
if ! _get_root "$fulldomain"; then
_err "invalid domain" _err "invalid domain"
return 1 return 1
fi fi
@ -69,7 +69,7 @@ dns_ultra_rm(){
fi fi
_debug "First detect the root zone" _debug "First detect the root zone"
if ! _get_root "${fulldomain}"; then
if ! _get_root "$fulldomain"; then
_err "invalid domain" _err "invalid domain"
return 1 return 1
fi fi
@ -87,7 +87,7 @@ dns_ultra_rm(){
count=$(printf "%s\n" "$response" | _egrep_o "\"returnedCount\":[^,]*" | cut -d: -f2 | cut -d'}' -f1) count=$(printf "%s\n" "$response" | _egrep_o "\"returnedCount\":[^,]*" | cut -d: -f2 | cut -d'}' -f1)
_debug count "${count}" _debug count "${count}"
if [ "${count}" -eq "" ]; then
if [ "${count}" = "" ]; then
_info "Text record is not present, will not delete anything." _info "Text record is not present, will not delete anything."
else else
if ! _ultra_rest DELETE "zones/$_domain_id/rrsets/TXT/${_sub_domain}" '{"ttl":300,"rdata":["'"${txtvalue}"'"]}'; then if ! _ultra_rest DELETE "zones/$_domain_id/rrsets/TXT/${_sub_domain}" '{"ttl":300,"rdata":["'"${txtvalue}"'"]}'; then
@ -152,7 +152,7 @@ _ultra_rest(){
_debug data "${data}" _debug data "${data}"
response="$(_post "${data}" "${ULTRA_API}"/"${ep}" "" "${m}")" response="$(_post "${data}" "${ULTRA_API}"/"${ep}" "" "${m}")"
else else
response="$(_get ${data} ${ULTRA_API}/${ep})"
response="$(_get "$ULTRA_API/$ep")"
fi fi
} }

Loading…
Cancel
Save