mirror of
https://github.com/acmesh-official/acme.sh.git
synced 2025-04-29 22:52:43 +00:00
Updated PUT request to hold only fqdn domain name values#
This commit is contained in:
parent
07220a324d
commit
35f3b7088d
@ -39,7 +39,7 @@ dns_mijn_host_add() {
|
|||||||
_debug "Add TXT record"
|
_debug "Add TXT record"
|
||||||
|
|
||||||
# Build the payload for the API
|
# Build the payload for the API
|
||||||
data="{\"type\":\"TXT\",\"name\":\"$_sub_domain\",\"value\":\"$txtvalue\",\"ttl\":120}"
|
data="{\"type\":\"TXT\",\"name\":\"$fulldomain.\",\"value\":\"$txtvalue\",\"ttl\":120}"
|
||||||
|
|
||||||
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"
|
||||||
@ -55,8 +55,8 @@ dns_mijn_host_add() {
|
|||||||
|
|
||||||
# Updating the records
|
# Updating the records
|
||||||
updated_records=$(echo "$records" | sed -E "s/\]( *$)/,$data\]/")
|
updated_records=$(echo "$records" | sed -E "s/\]( *$)/,$data\]/")
|
||||||
|
|
||||||
_debug "Updated records" "$updatedrecords"
|
_debug "Updated records" "$updated_records"
|
||||||
|
|
||||||
# data
|
# data
|
||||||
data="{\"records\": $updated_records}"
|
data="{\"records\": $updated_records}"
|
||||||
@ -106,20 +106,20 @@ dns_mijn_host_rm() {
|
|||||||
|
|
||||||
# Get current records
|
# Get current records
|
||||||
response="$(_get "$api_url")"
|
response="$(_get "$api_url")"
|
||||||
|
|
||||||
_debug "Get current records response:" "$response"
|
_debug "Get current records response:" "$response"
|
||||||
|
|
||||||
records=$(echo "$get_response" | _egrep_o '"records":\[.*\]' | sed 's/"records"://')
|
records=$(echo "$get_response" | _egrep_o '"records":\[.*\]' | sed 's/"records"://')
|
||||||
|
|
||||||
_debug "Current records:" "$records"
|
_debug "Current records:" "$records"
|
||||||
|
|
||||||
updated_records=$(echo "$updated_records" | sed -E "s/\{[^}]*\"value\":\"$txtvalue\"[^}]*\},?//g" | sed 's/,]/]/g')
|
updated_records=$(echo "$updated_records" | sed -E "s/\{[^}]*\"value\":\"$txtvalue\"[^}]*\},?//g" | sed 's/,]/]/g')
|
||||||
|
|
||||||
_debug "Updated records:" "$updated_records"
|
_debug "Updated records:" "$updated_records"
|
||||||
|
|
||||||
# Build the new payload
|
# Build the new payload
|
||||||
data="{\"records\": $updated_records}"
|
data="{\"records\": $updated_records}"
|
||||||
|
|
||||||
_debug "Payload:" "$data"
|
_debug "Payload:" "$data"
|
||||||
|
|
||||||
# Use the _put method to update the records
|
# Use the _put method to update the records
|
||||||
|
Loading…
x
Reference in New Issue
Block a user