-
-
Save theUncanny/d2fdf5b3230a177733f24bc876b3ff68 to your computer and use it in GitHub Desktop.
curl wrapper for Akamai debugging
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
usage() { | |
echo "usage: $0 [-s] [-v] [-L] [-h HTTPHOST] [-X HTTPMETHOD] URL" | |
exit 1 | |
} | |
args=`getopt svLX:h: $*` | |
if [ $? != 0 ] ; then | |
usage | |
fi | |
set -- $args | |
pragma="-H" | |
pragmaarg="Pragma: akamai-x-cache-on, akamai-x-cache-remote-on, akamai-x-check-cacheable, akamai-x-get-cache-key, akamai-x-get-ssl-client-session-id, akamai-x-get-true-cache-key, akamai-x-get-request-id" | |
method="-X GET" | |
host="" | |
hostarg="" | |
for i ; do | |
case "$i" in | |
-h) | |
host="-H" | |
hostarg="Host:$2" | |
shift | |
shift | |
;; | |
-X) | |
method="-X $2" | |
shift | |
shift | |
;; | |
-s|-v|-L) | |
options="$options $i" | |
shift | |
;; | |
--) | |
shift | |
break | |
;; | |
esac | |
done | |
if [ -z "$*" ] ; then | |
usage | |
fi | |
curl -I $method $host $hostarg $pragma "$pragmaarg" $options $* |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment