aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2016-07-05 11:57:12 +1200
committerTom Ryder <tom@sanctum.geek.nz>2016-07-05 11:57:12 +1200
commit58653cf629fddfc4cea6ac1430d32c89f02643f3 (patch)
treeff953586e78fdde28ce544fd4c52d8f307f6e2a3 /bin
parentSwitch kvlt(6) back to two phases of processing (diff)
downloaddotfiles-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-xbin/urlc4
1 files changed, 2 insertions, 2 deletions
diff --git a/bin/urlc b/bin/urlc
index 49f41082..2dd087c7 100755
--- a/bin/urlc
+++ b/bin/urlc
@@ -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++))