Skip to content

Instantly share code, notes, and snippets.

@notsobad
Last active April 23, 2019 07:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save notsobad/24683f3ee1df3e525aad80b08dabd73f to your computer and use it in GitHub Desktop.
Save notsobad/24683f3ee1df3e525aad80b08dabd73f to your computer and use it in GitHub Desktop.
#!/bin/bash
url=$1
argc=$#
argv=($@)
host=`echo $url | awk -F[/:] '{print $4}'`
for ((i=1; i<argc; i++)); do
ip=${argv[i]}
final_url=`echo $url | sed "s/$host/$ip/"`
echo "curl -H 'Host: $host' $final_url"
curl -k -H "Host: $host" $final_url -vv -o /dev/null 2>&1| grep -E '(X-Via-JSL:|X-Cache:)'
echo
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment