Skip to content

Commit

Permalink
Splits check-cnames
Browse files Browse the repository at this point in the history
  • Loading branch information
tomnomnom committed Jun 26, 2018
1 parent d9f6c00 commit 5752ba2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
14 changes: 14 additions & 0 deletions scripts/check-cname
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

domain="$1"

if [ -z "$domain" ]; then
exit 1
fi

host -t CNAME "$domain" | grep 'is an alias for' | awk '{print $NF}' |
while read cname; do
if ! host "$cname" &>/dev/null; then
echo "$cname does not resolve (pointed at by $domain)";
fi;
done
9 changes: 1 addition & 8 deletions scripts/check-cnames.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,2 @@
#!/bin/bash

xargs -P20 -n1 -I{} bash -c "host -t CNAME {} |
grep 'is an alias for' | awk '{print \$NF}' |
while read cname; do
if ! host \$cname &>/dev/null; then
echo \"\$cname does not resolve (pointed at by {})\";
fi;
done"
xargs -P20 -n1 -I{} check-cname {}

0 comments on commit 5752ba2

Please sign in to comment.