Browse Source
escape brackets in regexp and format using shfmt
pull/5110/head
zak905
8 months ago
No known key found for this signature in database
GPG Key ID: A5683652694BD72B
1 changed files with
12 additions and
12 deletions
-
dnsapi/dns_ionos.sh
|
|
@ -216,7 +216,7 @@ _ionos_cloud_get_record() { |
|
|
|
if _ionos_cloud_rest GET "$IONOS_CLOUD_ROUTE_ZONES/$zone_id/records"; then |
|
|
|
_response="$(echo "$_response" | tr -d "\n")" |
|
|
|
|
|
|
|
pattern="{\"id\":\"[a-fA-F0-9\-]*\",\"type\":\"record\",\"href\":\"/zones/$zone_id/records/[a-fA-F0-9\-]*\",\"metadata\":{\"createdDate\":\"[A-Z0-9\:\.\-]*\",\"lastModifiedDate\":\"[A-Z0-9\:\.\-]*\",\"fqdn\":\"$fulldomain\",\"state\":\"AVAILABLE\",\"zoneId\":\"$zone_id\"},\"properties\":{\"content\":\"$txtrecord\",\"enabled\":true,\"name\":\"$_record_name\",\"priority\":[0-9]*,\"ttl\":[0-9]*,\"type\":\"TXT\"}}" |
|
|
|
pattern="\{\"id\":\"[a-fA-F0-9\-]*\",\"type\":\"record\",\"href\":\"/zones/$zone_id/records/[a-fA-F0-9\-]*\",\"metadata\":\{\"createdDate\":\"[A-Z0-9\:\.\-]*\",\"lastModifiedDate\":\"[A-Z0-9\:\.\-]*\",\"fqdn\":\"$fulldomain\",\"state\":\"AVAILABLE\",\"zoneId\":\"$zone_id\"\},\"properties\":\{\"content\":\"$txtrecord\",\"enabled\":true,\"name\":\"$_record_name\",\"priority\":[0-9]*,\"ttl\":[0-9]*,\"type\":\"TXT\"\}\}" |
|
|
|
|
|
|
|
_record="$(echo "$_response" | _egrep_o "$pattern")" |
|
|
|
_info "the found record after grep: $_record" |
|
|
|