Browse Source
Merge pull request #3146 from ym/dev
fix misaka.io api: breaking changes introduced by apiv1
pull/3154/head
neil
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
2 additions and
2 deletions
-
dnsapi/dns_misaka.sh
|
@ -47,7 +47,7 @@ dns_misaka_add() { |
|
|
if [ "$count" = "0" ]; then |
|
|
if [ "$count" = "0" ]; then |
|
|
_info "Adding record" |
|
|
_info "Adding record" |
|
|
|
|
|
|
|
|
if _misaka_rest PUT "zones/${_domain}/recordsets/${_sub_domain}/TXT" "{\"records\":[{\"value\":\"\\\"$txtvalue\\\"\"}],\"filters\":[],\"ttl\":1}"; then |
|
|
|
|
|
|
|
|
if _misaka_rest POST "zones/${_domain}/recordsets/${_sub_domain}/TXT" "{\"records\":[{\"value\":\"\\\"$txtvalue\\\"\"}],\"filters\":[],\"ttl\":1}"; then |
|
|
_debug response "$response" |
|
|
_debug response "$response" |
|
|
if _contains "$response" "$_sub_domain"; then |
|
|
if _contains "$response" "$_sub_domain"; then |
|
|
_info "Added" |
|
|
_info "Added" |
|
@ -61,7 +61,7 @@ dns_misaka_add() { |
|
|
else |
|
|
else |
|
|
_info "Updating record" |
|
|
_info "Updating record" |
|
|
|
|
|
|
|
|
_misaka_rest POST "zones/${_domain}/recordsets/${_sub_domain}/TXT?append=true" "{\"records\": [{\"value\": \"\\\"$txtvalue\\\"\"}],\"ttl\":1}" |
|
|
|
|
|
|
|
|
_misaka_rest PUT "zones/${_domain}/recordsets/${_sub_domain}/TXT?append=true" "{\"records\": [{\"value\": \"\\\"$txtvalue\\\"\"}],\"ttl\":1}" |
|
|
if [ "$?" = "0" ] && _contains "$response" "$_sub_domain"; then |
|
|
if [ "$?" = "0" ] && _contains "$response" "$_sub_domain"; then |
|
|
_info "Updated!" |
|
|
_info "Updated!" |
|
|
#todo: check if the record takes effect |
|
|
#todo: check if the record takes effect |
|
|