mirror of
https://github.com/acmesh-official/acme.sh.git
synced 2025-05-05 11:32:45 +00:00
added dnsapi for internetx autodns json api
This commit is contained in:
parent
7fab4269a5
commit
5899090bbc
@ -45,7 +45,7 @@ dns_autodns_json_add() {
|
||||
_post_data="{\"adds\":[{\"name\":\"$_autodns_sub_domain\",\"ttl\":600,\"type\":\"TXT\",\"value\":\"$txtvalue\"}]}"
|
||||
_response="$(dns_autodns_api_call "/zone/$_autodns_zone/_stream" "$_post_data")"
|
||||
|
||||
if [ "$?" -eq "0" ] && _contains "$_response" '{"type":"Zone","summary":1}'; then
|
||||
if _contains "$_response" '{"type":"Zone","summary":1}'; then
|
||||
_info "Added, OK"
|
||||
return 0
|
||||
fi
|
||||
@ -64,7 +64,6 @@ dns_autodns_json_rm() {
|
||||
AUTODNS_PASSWORD="${AUTODNS_PASSWORD:-$(_readaccountconf_mutable AUTODNS_PASSWORD)}"
|
||||
AUTODNS_CONTEXT="${AUTODNS_CONTEXT:-$(_readaccountconf_mutable AUTODNS_CONTEXT)}"
|
||||
|
||||
|
||||
if ! _get_autodns_zone "$fulldomain"; then
|
||||
_err "invalid domain"
|
||||
return 1
|
||||
@ -74,7 +73,7 @@ dns_autodns_json_rm() {
|
||||
_post_data="{\"rems\":[{\"name\":\"$_autodns_sub_domain\",\"type\":\"TXT\",\"value\":\"$txtvalue\"}]}"
|
||||
_response="$(dns_autodns_api_call "/zone/$_autodns_zone/_stream" "$_post_data")"
|
||||
|
||||
if [ "$?" -eq "0" ] && _contains "$_response" '{"type":"Zone","summary":1}'; then
|
||||
if _contains "$_response" '{"type":"Zone","summary":1}'; then
|
||||
_info "Deleted, OK"
|
||||
return 0
|
||||
fi
|
||||
@ -82,7 +81,6 @@ dns_autodns_json_rm() {
|
||||
return 1
|
||||
}
|
||||
|
||||
|
||||
dns_autodns_api_call() {
|
||||
_api_route="$1"
|
||||
_post_data="$2"
|
||||
@ -150,4 +148,4 @@ _get_autodns_zone() {
|
||||
done
|
||||
|
||||
return 1
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user