mirror of
https://github.com/acmesh-official/acme.sh.git
synced 2025-06-15 09:22:44 +00:00
Update dns_wts.sh
Fully integrated new WTS-API for updating dns-records.
This commit is contained in:
parent
287381c210
commit
1483ecb69f
@ -13,6 +13,8 @@ WTS_API="https://wts-api.de/hosting/domain"
|
||||
|
||||
######## Public functions ######################
|
||||
|
||||
TMP_RecordID=0 # Temporary Id of the creazed record will be safed here.
|
||||
|
||||
#Usage: dns_wts_add _acme-challenge.domain.waerner-techservices.de "XKrxpRBosdIKFzxW_CT3KLZNf6q0HG9i01zxXp5CPBs"
|
||||
dns_wts_add() {
|
||||
fulldomain=$1
|
||||
@ -41,7 +43,8 @@ dns_wts_add() {
|
||||
_sub_domain="$(echo "$_sub_domain" | _lower_case)"
|
||||
# Now add the TXT record
|
||||
_info "Trying to add TXT record"
|
||||
if _WTS_rest "POST" "add_record=$_domain&praefix=$_sub_domain&type=TXT&content=$txtvalue"; then
|
||||
# if _WTS_rest "POST" "add_record=$_domain&praefix=$_sub_domain&type=TXT&content=$txtvalue"; then
|
||||
if _WTS_rest "POST" "/$_domain/records/add/txt/$_sub_domain/$txtvalue?WTS-API-Token=$WTS_API_Token"; then
|
||||
_info "TXT record has been successfully added."
|
||||
return 0
|
||||
else
|
||||
@ -78,7 +81,7 @@ dns_wts_rm() {
|
||||
_sub_domain="$(echo "$_sub_domain" | _lower_case)"
|
||||
# Now delete the TXT record
|
||||
_info "Trying to delete TXT record"
|
||||
if _WTS_rest "DELETE" "del_record=$_domain&praefix=$_sub_domain&type=TXT&content=$txtvalue"; then
|
||||
if _WTS_rest "DELETE" "/$_domain/records/remove/$TMP_RecordID?WTS-API-Token=$WTS_API_Token"; then
|
||||
_info "TXT record has been successfully deleted."
|
||||
return 0
|
||||
else
|
||||
|
Loading…
x
Reference in New Issue
Block a user