#!/bin/sh
# Prints the status line, content type and redirect count for /robots.txt on each scenario host.
for h in ok missing blocked limited down spa chain; do
  printf '%-14s ' "$h.test"
  curl -s -o /dev/null --noproxy '*' -L --max-redirs 10 --resolve "$h.test:8099:127.0.0.1" \
    -w '%{http_code} %{content_type} redirects=%{num_redirects}\n' "http://$h.test:8099/robots.txt"
done
echo
echo 'Same chain, stopping after five redirects:'
curl -s -o /dev/null --noproxy '*' -L --max-redirs 5 --resolve 'chain.test:8099:127.0.0.1' \
  -w '%{http_code} redirects=%{num_redirects} exit=' 'http://chain.test:8099/robots.txt'; echo $?
