mirror of
				https://github.com/hiskang/acme.sh
				synced 2025-11-04 12:28:12 +00:00 
			
		
		
		
	Update dns api to support v2 wildcard cert #1261
This commit is contained in:
		
							parent
							
								
									94b925f5ef
								
							
						
					
					
						commit
						41e3ecad46
					
				@ -26,30 +26,18 @@ dns_cloudns_add() {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  host="$(echo "$1" | sed "s/\.$zone\$//")"
 | 
					  host="$(echo "$1" | sed "s/\.$zone\$//")"
 | 
				
			||||||
  record=$2
 | 
					  record=$2
 | 
				
			||||||
  record_id=$(_dns_cloudns_get_record_id "$zone" "$host")
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
  _debug zone "$zone"
 | 
					  _debug zone "$zone"
 | 
				
			||||||
  _debug host "$host"
 | 
					  _debug host "$host"
 | 
				
			||||||
  _debug record "$record"
 | 
					  _debug record "$record"
 | 
				
			||||||
  _debug record_id "$record_id"
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if [ -z "$record_id" ]; then
 | 
					  _info "Adding the TXT record for $1"
 | 
				
			||||||
    _info "Adding the TXT record for $1"
 | 
					  _dns_cloudns_http_api_call "dns/add-record.json" "domain-name=$zone&record-type=TXT&host=$host&record=$record&ttl=60"
 | 
				
			||||||
    _dns_cloudns_http_api_call "dns/add-record.json" "domain-name=$zone&record-type=TXT&host=$host&record=$record&ttl=60"
 | 
					  if ! _contains "$response" "\"status\":\"Success\""; then
 | 
				
			||||||
    if ! _contains "$response" "\"status\":\"Success\""; then
 | 
					    _err "Record cannot be added."
 | 
				
			||||||
      _err "Record cannot be added."
 | 
					    return 1
 | 
				
			||||||
      return 1
 | 
					 | 
				
			||||||
    fi
 | 
					 | 
				
			||||||
    _info "Added."
 | 
					 | 
				
			||||||
  else
 | 
					 | 
				
			||||||
    _info "Updating the TXT record for $1"
 | 
					 | 
				
			||||||
    _dns_cloudns_http_api_call "dns/mod-record.json" "domain-name=$zone&record-id=$record_id&record-type=TXT&host=$host&record=$record&ttl=60"
 | 
					 | 
				
			||||||
    if ! _contains "$response" "\"status\":\"Success\""; then
 | 
					 | 
				
			||||||
      _err "The TXT record for $1 cannot be updated."
 | 
					 | 
				
			||||||
      return 1
 | 
					 | 
				
			||||||
    fi
 | 
					 | 
				
			||||||
    _info "Updated."
 | 
					 | 
				
			||||||
  fi
 | 
					  fi
 | 
				
			||||||
 | 
					  _info "Added."
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  return 0
 | 
					  return 0
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user