Skip to content

Commit

Permalink
Merge pull request #2 from acast-tech/fix/output-parsing
Browse files Browse the repository at this point in the history
fix: parse dig output into an array of IPs
  • Loading branch information
petrenkotino authored Nov 17, 2020
2 parents b4da0fb + b4e2ad1 commit bab307f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion render_cfg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ else

# Resolve DNS
for _service in ${service//,/ }; do
dig $_service 2>/dev/null | gawk '/'$_service'. /{ if (length ($5) > 1) print $5}'
dig $_service 2>/dev/null | grep ^$_service | awk '{print $5}'
done | sort | paste -sd ',' > $tmpfile
if [ $(wc -c $tmpfile | gawk '{print $1}') -eq 0 ]; then
rm $tmpfile
Expand Down

0 comments on commit bab307f

Please sign in to comment.