Cleanup/ removed private function _get_root
Function _get_root() copied from acme.sh and is not needed here. Other cleanup as recommended by acme.sh test bot.
This commit is contained in:
parent
f500c7abcb
commit
47c33d0344
@ -61,7 +61,6 @@ dns_miab_add() {
|
||||
_err "$result"
|
||||
return 1
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
#Usage: fulldomain txtvalue
|
||||
@ -101,7 +100,7 @@ dns_miab_rm() {
|
||||
#Remove the challenge record
|
||||
result="$(_miab_post "$txtvalue" "$baseurl" "" "DELETE" "" "$MIAB_Username" "$MIAB_Password")"
|
||||
|
||||
_debug result $result
|
||||
_debug result "$result"
|
||||
|
||||
#check if result was good
|
||||
if _contains "$result" "updated DNS"; then
|
||||
@ -115,43 +114,7 @@ dns_miab_rm() {
|
||||
}
|
||||
|
||||
#################### Private functions below ##################################
|
||||
#_acme-challenge.www.domain.com
|
||||
#returns
|
||||
# _sub_domain=_acme-challenge.www
|
||||
# _domain=domain.com
|
||||
# _domain_id=sdjkglgdfewsdfg
|
||||
_get_root() {
|
||||
domain=$1
|
||||
i=2
|
||||
p=1
|
||||
|
||||
while true; do
|
||||
h=$(printf "%s" "$domain" | cut -d . -f $i-100)
|
||||
_debug h "$h"
|
||||
if [ -z "$h" ]; then
|
||||
#not valid
|
||||
return 1
|
||||
fi
|
||||
|
||||
if _contains "$response" "\"name\":\"$h\"" >/dev/null; then
|
||||
_domain_id=$(printf "%s\n" "$response" | _egrep_o "\[.\"id\":\"[^\"]*\"" | head -n 1 | cut -d : -f 2 | tr -d \")
|
||||
|
||||
if [ "$_domain_id" ]; then
|
||||
_sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-$p)
|
||||
_domain=$h
|
||||
return 0
|
||||
fi
|
||||
|
||||
return 1
|
||||
fi
|
||||
|
||||
p=$i
|
||||
i=$(_math "$i" + 1)
|
||||
done
|
||||
|
||||
return 1
|
||||
}
|
||||
|
||||
#
|
||||
# post changes to MIAB dns (taken from acme.sh)
|
||||
_miab_post() {
|
||||
body="$1"
|
||||
|
Loading…
Reference in New Issue
Block a user