mirror of
https://github.com/acmesh-official/acme.sh.git
synced 2025-04-30 01:32:44 +00:00
feat: Update DNS API URL to use extracted domain
This commit is contained in:
parent
11966d08c9
commit
b6d002cb1c
@ -42,8 +42,10 @@ dns_mijn_host_add() {
|
|||||||
export _H1="API-Key: $MIJN_HOST_API_KEY"
|
export _H1="API-Key: $MIJN_HOST_API_KEY"
|
||||||
export _H2="Content-Type: application/json"
|
export _H2="Content-Type: application/json"
|
||||||
|
|
||||||
|
extracted_domain="${fulldomain#*_acme-challenge.}"
|
||||||
|
|
||||||
# Construct the API URL
|
# Construct the API URL
|
||||||
api_url="$MIJN_HOST_API/domains/$_domain/dns"
|
api_url="$MIJN_HOST_API/domains/$extracted_domain/dns"
|
||||||
|
|
||||||
# Getting preivous records
|
# Getting preivous records
|
||||||
get_response="$(_get "$api_url")"
|
get_response="$(_get "$api_url")"
|
||||||
@ -58,7 +60,6 @@ dns_mijn_host_add() {
|
|||||||
# Use the _post method to make the API request
|
# Use the _post method to make the API request
|
||||||
response="$(_post "$data" "$api_url" "" "PUT")"
|
response="$(_post "$data" "$api_url" "" "PUT")"
|
||||||
|
|
||||||
|
|
||||||
if _contains "$response" "error"; then
|
if _contains "$response" "error"; then
|
||||||
_err "Error adding TXT record: $response"
|
_err "Error adding TXT record: $response"
|
||||||
return 1
|
return 1
|
||||||
@ -91,9 +92,11 @@ dns_mijn_host_rm() {
|
|||||||
# Build the payload for the API
|
# Build the payload for the API
|
||||||
export _H1="API-Key: $MIJN_HOST_API_KEY"
|
export _H1="API-Key: $MIJN_HOST_API_KEY"
|
||||||
export _H2="Content-Type: application/json"
|
export _H2="Content-Type: application/json"
|
||||||
|
|
||||||
|
extracted_domain="${fulldomain#*_acme-challenge.}"
|
||||||
|
|
||||||
# Construct the API URL
|
# Construct the API URL
|
||||||
api_url="$MIJN_HOST_API/domains/$_domain/dns"
|
api_url="$MIJN_HOST_API/domains/$extracted_domain/dns"
|
||||||
|
|
||||||
# Get current records
|
# Get current records
|
||||||
response="$(_get "$api_url")"
|
response="$(_get "$api_url")"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user