Speedup for _get_root function

This commit is contained in:
ma331 authored and GitHub committed 2020-10-30 14:13:32 +01:00
1 parent 812333e9ae
commit d58fb2bbc0
1 file changed
+2 -11
+2 -11
View File
@@ -122,15 +122,13 @@ _anx_rest() {
return 0
}
#_acme-challenge.www.domain.com
#returns
# _sub_domain=_acme-challenge.www
# _domain=domain.com
_get_root() {
domain=$1
i=1
p=1
_anx_rest GET "zone.json"
while true; do
h=$(printf "%s" "$domain" | cut -d . -f $i-100)
_debug h "$h"
@@ -139,13 +137,6 @@ _get_root() {
return 1
fi
# Does a zone with that name exist?
_anx_rest GET "zone.json/$h"
# shellcheck disable=SC2154
if [ "$code" -ne 200 ]; then
continue
fi
if _contains "$response" "\"name\":\"$h\""; then
_sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-$p)
_domain=$h
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.