Browse Source

Changes requested on commit review

dnsconf
Adrian Almenar 6 years ago
parent
commit
f4ad42bb84
  1. 8
      dnsapi/dns_neodigit.sh

8
dnsapi/dns_neodigit.sh

@ -17,7 +17,7 @@ dns_neodigit_add() {
fulldomain=$1 fulldomain=$1
txtvalue=$2 txtvalue=$2
NEODIGIT_API_TOKEN="${NEODIGIT_API_TOKEN:-$(_readaccountconf_mutable NEODIGIT_API_TOKEN)}"
NEODIGIT_API_TOKEN="$(_readaccountconf_mutable NEODIGIT_API_TOKEN)}"
if [ -z "$NEODIGIT_API_TOKEN" ]; then if [ -z "$NEODIGIT_API_TOKEN" ]; then
NEODIGIT_API_TOKEN="" NEODIGIT_API_TOKEN=""
_err "You haven't specified a Token api key." _err "You haven't specified a Token api key."
@ -73,7 +73,7 @@ dns_neodigit_rm() {
fulldomain=$1 fulldomain=$1
txtvalue=$2 txtvalue=$2
NEODIGIT_API_TOKEN="${NEODIGIT_API_TOKEN:-$(_readaccountconf_mutable NEODIGIT_API_TOKEN)}"
NEODIGIT_API_TOKEN="$(_readaccountconf_mutable NEODIGIT_API_TOKEN)}"
if [ -z "$NEODIGIT_API_TOKEN" ]; then if [ -z "$NEODIGIT_API_TOKEN" ]; then
NEODIGIT_API_TOKEN="" NEODIGIT_API_TOKEN=""
_err "You haven't specified a Token api key." _err "You haven't specified a Token api key."
@ -102,7 +102,7 @@ dns_neodigit_rm() {
return 1 return 1
fi fi
record_id=$(printf "%s\n" "$response" | _egrep_o "\"id\":\s*[0-9]+" | _head_n 1 | cut -d: -f2 | cut -d, -f1)
record_id=$(echo "$response" | _egrep_o "\"id\":\s*[0-9]+" | _head_n 1 | cut -d: -f2 | cut -d, -f1)
_debug "record_id" "$record_id" _debug "record_id" "$record_id"
if [ -z "$record_id" ]; then if [ -z "$record_id" ]; then
_err "Can not get record id to remove." _err "Can not get record id to remove."
@ -140,7 +140,7 @@ _get_root() {
_debug p "$p" _debug p "$p"
if _contains "$response" "\"name\":\"$h\"" >/dev/null; then if _contains "$response" "\"name\":\"$h\"" >/dev/null; then
_domain_id=$(printf "%s\n" "$response" | _egrep_o "\"id\":\s*[0-9]+" | _head_n 1 | cut -d: -f2 | cut -d, -f1)
_domain_id=$(echo "$response" | _egrep_o "\"id\":\s*[0-9]+" | _head_n 1 | cut -d: -f2 | cut -d, -f1)
if [ "$_domain_id" ]; then if [ "$_domain_id" ]; then
_sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-$p) _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-$p)
_domain=$h _domain=$h

Loading…
Cancel
Save