Browse Source

feat: Update DNS API URL to use extracted domain

pull/5287/head
Shubham Sharma 2 months ago
parent
commit
b6d002cb1c
  1. 9
      dnsapi/dns_mijn_host.sh

9
dnsapi/dns_mijn_host.sh

@ -42,8 +42,10 @@ dns_mijn_host_add() {
export _H1="API-Key: $MIJN_HOST_API_KEY"
export _H2="Content-Type: application/json"
extracted_domain="${fulldomain#*_acme-challenge.}"
# Construct the API URL
api_url="$MIJN_HOST_API/domains/$_domain/dns"
api_url="$MIJN_HOST_API/domains/$extracted_domain/dns"
# Getting preivous records
get_response="$(_get "$api_url")"
@ -58,7 +60,6 @@ dns_mijn_host_add() {
# Use the _post method to make the API request
response="$(_post "$data" "$api_url" "" "PUT")"
if _contains "$response" "error"; then
_err "Error adding TXT record: $response"
return 1
@ -92,8 +93,10 @@ dns_mijn_host_rm() {
export _H1="API-Key: $MIJN_HOST_API_KEY"
export _H2="Content-Type: application/json"
extracted_domain="${fulldomain#*_acme-challenge.}"
# Construct the API URL
api_url="$MIJN_HOST_API/domains/$_domain/dns"
api_url="$MIJN_HOST_API/domains/$extracted_domain/dns"
# Get current records
response="$(_get "$api_url")"

Loading…
Cancel
Save