|
@ -37,7 +37,8 @@ dns-cf-add() { |
|
|
if _cf_rest POST "/zones/$_domain_id/dns_records" "{\"type\":\"TXT\",\"name\":\"$fulldomain\",\"content\":\"$txtvalue\",\"ttl\":120}"; then |
|
|
if _cf_rest POST "/zones/$_domain_id/dns_records" "{\"type\":\"TXT\",\"name\":\"$fulldomain\",\"content\":\"$txtvalue\",\"ttl\":120}"; then |
|
|
if printf $response | grep $fulldomain > /dev/null ; then |
|
|
if printf $response | grep $fulldomain > /dev/null ; then |
|
|
_info "Added, sleeping 10 seconds" |
|
|
_info "Added, sleeping 10 seconds" |
|
|
sleep 1 |
|
|
|
|
|
|
|
|
sleep 10 |
|
|
|
|
|
#todo: check if the record takes effect |
|
|
return 0 |
|
|
return 0 |
|
|
else |
|
|
else |
|
|
_err "Add txt record error." |
|
|
_err "Add txt record error." |
|
@ -54,6 +55,7 @@ dns-cf-add() { |
|
|
if [ "$?" == "0" ]; then |
|
|
if [ "$?" == "0" ]; then |
|
|
_info "Updated, sleeping 10 seconds" |
|
|
_info "Updated, sleeping 10 seconds" |
|
|
sleep 10 |
|
|
sleep 10 |
|
|
|
|
|
#todo: check if the record takes effect |
|
|
return 0; |
|
|
return 0; |
|
|
fi |
|
|
fi |
|
|
_err "Update error" |
|
|
_err "Update error" |
|
|