]> git.proxmox.com Git - mirror_acme.sh.git/commitdiff
fix: fix delete txt record and error mngtt
authorVan Hau TRAN <vanonox@gmail.com>
Tue, 8 Dec 2020 15:32:31 +0000 (16:32 +0100)
committerVan Hau TRAN <vanonox@gmail.com>
Tue, 8 Dec 2020 15:32:31 +0000 (16:32 +0100)
dnsapi/dns_scaleway.sh

index 778738f4d1bd9c818aa286b4776c4fda3dd950da..a0a0f3183d8bbf121e8a85589b58c421677123f2 100755 (executable)
@@ -29,6 +29,12 @@ dns_scaleway_add() {
 
   _info "Adding record"
   _scaleway_create_TXT_record "$_domain" "$_sub_domain" "$txtvalue"
+  if _contains "$response" "records"; then
+    return 0
+  else
+    _err error "$response"
+    return 1
+  fi
   _info "Record added."
 
   return 0
@@ -52,7 +58,13 @@ dns_scaleway_rm() {
   _debug _domain "$_domain"
 
   _info "Deleting record"
-  _scaleway_create_TXT_record "$_domain" "$_sub_domain" "$txtvalue"
+  _scaleway_delete_TXT_record "$_domain" "$_sub_domain" "$txtvalue"
+  if _contains "$response" "records"; then
+    return 0
+  else
+    _err error "$response"
+    return 1
+  fi
   _info "Record deleted."
 
   return 0
@@ -83,7 +95,7 @@ _scaleway_check_config() {
 # _domain=domain.com
 _get_root() {
   domain=$1
-  i=2
+  i=1
   p=1
   while true; do
     h=$(printf "%s" "$domain" | cut -d . -f $i-100)