diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2016-07-05 11:57:12 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2016-07-05 11:57:12 +1200 |
commit | 58653cf629fddfc4cea6ac1430d32c89f02643f3 (patch) | |
tree | ff953586e78fdde28ce544fd4c52d8f307f6e2a3 /bin | |
parent | Switch kvlt(6) back to two phases of processing (diff) | |
download | dotfiles-58653cf629fddfc4cea6ac1430d32c89f02643f3.tar.gz dotfiles-58653cf629fddfc4cea6ac1430d32c89f02643f3.zip |
Pretend to be Mozilla in urlc(1)
Because Amazon tells me to go away when I use the default user agent. I
don't really feel sorry for it, because it throws a misleading 503 error
too.
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/urlc | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -36,7 +36,7 @@ while read -r url ; do [[ $url == 'http'* ]] || continue # Make initial request, log head and body to files, cry and skip on error - if ! curl -fHLsS -D "$head" -m "$tm" -o "$body" -- "$url" ; then + if ! curl -A Mozilla -fHLsS -D "$head" -m "$tm" -o "$body" -- "$url" ; then printf '%s: %s raises error\n' \ "$self" "$url" >&2 ((errc++)) @@ -58,7 +58,7 @@ while read -r url ; do # Form a naïve attempt at a possible secure URL and try to request it, # point it out if it actually works securl=${url/http:/https:} - if curl -fLsS -D "$head" -m "$tm" -o "$body" -- "$securl" 2>/dev/null ; then + if curl -A Mozilla -fLsS -D "$head" -m "$tm" -o "$body" -- "$securl" 2>/dev/null ; then printf '%s: %s has a working secure version at %s\n' \ "$self" "$url" "$securl" >&2 ((errc++)) |