mirror of
https://github.com/acmesh-official/acme.sh.git
synced 2025-05-05 23:17:41 +00:00
Record ID for removal can be accessed directly now
This commit is contained in:
parent
c32a62a4c4
commit
d072b2c9f8
@ -132,14 +132,11 @@ _ISPC_addTxt() {
|
|||||||
|
|
||||||
_ISPC_rmTxt() {
|
_ISPC_rmTxt() {
|
||||||
# Need to get the record ID.
|
# Need to get the record ID.
|
||||||
curData="{\"session_id\":\"${sessionID}\",\"primary_id\":[{\"name\":\"${fulldomain}.\"}]}"
|
primary="\"primary_id\":{\"name\":\"${fulldomain}.\",\"type\":\"TXT\"}"
|
||||||
|
curData="{\"session_id\":\"${sessionID}\",\"primary_id\":{\"name\":\"${fulldomain}.\",\"type\":\"TXT\"}}"
|
||||||
curResult="$(_post "${curData}" "${ISPC_Api}?dns_txt_get")"
|
curResult="$(_post "${curData}" "${ISPC_Api}?dns_txt_get")"
|
||||||
# The array search doesn't work properly... so we loop through all retrieved records and check if it contains $fulldomain
|
if _contains "${curResult}" '"code":"ok"'; then
|
||||||
IFS='{'
|
record_id=$(echo "${curResult}" | _egrep_o "\"id.*" | cut -d ':' -f 2 | cut -d '"' -f 2)
|
||||||
for i in ${curResult}; do
|
|
||||||
if _contains "${i}" "${fulldomain}"; then
|
|
||||||
_info "Retrieved ACME Challenge TXT record."
|
|
||||||
record_id=$(echo "${i}" | _egrep_o "\"id.*" | cut -d ':' -f 2 | cut -d '"' -f 2)
|
|
||||||
case "${record_id}" in
|
case "${record_id}" in
|
||||||
'' | *[!0-9]*)
|
'' | *[!0-9]*)
|
||||||
_err "Record ID is not numeric."
|
_err "Record ID is not numeric."
|
||||||
@ -147,7 +144,7 @@ _ISPC_rmTxt() {
|
|||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
unset IFS
|
unset IFS
|
||||||
_info "Retrieved Record ID"
|
_info "Retrieved Record ID."
|
||||||
curData="{\"session_id\":\"${sessionID}\",\"primary_id\":\"${record_id}\"}"
|
curData="{\"session_id\":\"${sessionID}\",\"primary_id\":\"${record_id}\"}"
|
||||||
curResult="$(_post "${curData}" "${ISPC_Api}?dns_txt_delete")"
|
curResult="$(_post "${curData}" "${ISPC_Api}?dns_txt_delete")"
|
||||||
if _contains "${curResult}" '"code":"ok"'; then
|
if _contains "${curResult}" '"code":"ok"'; then
|
||||||
@ -159,5 +156,4 @@ _ISPC_rmTxt() {
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
done
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user