fix whitespaces

This commit is contained in:
rserpent 2019-10-16 16:25:38 +05:00 committed by GitHub
parent e00f0b4cf1
commit ffa5472b31
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 22 additions and 22 deletions

View File

@ -79,7 +79,7 @@ dns_nic_rm() {
_err "Invalid domain" _err "Invalid domain"
return 1 return 1
fi fi
_debug _sub_domain "$_sub_domain" _debug _sub_domain "$_sub_domain"
_debug _domain "$_domain" _debug _domain "$_domain"
_debug _service "$_service" _debug _service "$_service"
@ -129,28 +129,28 @@ _get_root() {
p=1 p=1
if ! _nic_rest GET "zones"; then if ! _nic_rest GET "zones"; then
return 1 return 1
fi fi
_all_domains=$(printf "%s" "$response" | grep "idn-name" | sed -r "s/.*idn-name=\"(.*)\" name=.*/\1/g") _all_domains=$(printf "%s" "$response" | grep "idn-name" | sed -r "s/.*idn-name=\"(.*)\" name=.*/\1/g")
_debug2 _all_domains "$_all_domains" _debug2 _all_domains "$_all_domains"
while true; do while true; do
h=$(printf "%s" "$domain" | cut -d . -f "$i"-100) h=$(printf "%s" "$domain" | cut -d . -f "$i"-100)
_debug h "$h" _debug h "$h"
if [ -z "$h" ]; then if [ -z "$h" ]; then
return 1 return 1
fi fi
if _contains "$_all_domains" "^$h$"; then if _contains "$_all_domains" "^$h$"; 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
_service=$(printf "%s" "$response" | grep "$_domain" | sed -r "s/.*service=\"(.*)\".*$/\1/") _service=$(printf "%s" "$response" | grep "$_domain" | sed -r "s/.*service=\"(.*)\".*$/\1/")
return 0 return 0
fi fi
p="$i" p="$i"
i=$(_math "$i" + 1) i=$(_math "$i" + 1)
done done
return 1 return 1
} }
@ -165,20 +165,20 @@ _nic_rest() {
export _H2="Authorization: Bearer $_auth_token" export _H2="Authorization: Bearer $_auth_token"
if [ "$m" != "GET" ]; then if [ "$m" != "GET" ]; then
_debug data "$data" _debug data "$data"
response=$(_post "$data" "$NIC_Api/dns-master/$ep" "" "$m") response=$(_post "$data" "$NIC_Api/dns-master/$ep" "" "$m")
else else
response=$(_get "$NIC_Api/dns-master/$ep") response=$(_get "$NIC_Api/dns-master/$ep")
fi fi
if _contains "$response" "<errors>"; then if _contains "$response" "<errors>"; then
error=$(printf "%s" "$response" | grep "error code" | sed -r "s/.*<error code=.*>(.*)<\/error>/\1/g") error=$(printf "%s" "$response" | grep "error code" | sed -r "s/.*<error code=.*>(.*)<\/error>/\1/g")
_err "Error: $error" _err "Error: $error"
return 1 return 1
fi fi
if ! _contains "$response" "<status>success</status>"; then if ! _contains "$response" "<status>success</status>"; then
return 1 return 1
fi fi
_debug2 response "$response" _debug2 response "$response"
return 0 return 0