fix regex of matching hetzner dns api error responses

This commit is contained in:
Lindsay Zhou 2025-01-13 10:22:46 +08:00
parent 0ae80272fb
commit 6c555cb666
No known key found for this signature in database
GPG Key ID: ECBDA6E4719D5816

2
dnsapi/dns_hetzner.sh Normal file → Executable file
View File

@ -212,7 +212,7 @@ _get_root() {
_response_has_error() {
unset _response_error
err_part="$(echo "$response" | _egrep_o '"error":{[^}]*}')"
err_part="$(echo "$response" | _egrep_o '"error":\{[^\}]*\}')"
if [ -n "$err_part" ]; then
err_code=$(echo "$err_part" | _egrep_o '"code":[0-9]+' | cut -d : -f 2)