Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

handle TXT records with double quotes

  • Loading branch information...
commit 5898acf3a1f10e0c50aaa3ea28001dddecffa8dc 1 parent cec433b
@Geal authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  dns/dns
View
2  dns/dns
@@ -38,7 +38,7 @@ else
arr=( $(dig $1 TXT 2>/dev/null) );
for line in "${arr[@]}"; do
regex="^$1.*TXT[[:space:]]*(.*)"
- if [[ "$line" =~ $regex ]] ; then echo ",{\"name\": \"TXT\", \"value\":\"${BASH_REMATCH[1]}\"}"; fi
+ if [[ "$line" =~ $regex ]] ; then txt=$(echo ${BASH_REMATCH[1]} | sed 's/"/\\"/g'); echo ",{\"name\": \"TXT\", \"value\":\"${txt[@]}\"}"; fi
done
echo " ] }";
fi
Please sign in to comment.
Something went wrong with that request. Please try again.