#!/usr/bin/env bash
# Cloudrepo HTTP field probe. Usage: bash http-probe.sh https://example.com
set -eu
if [ "$#" -ne 1 ]; then
  printf 'Usage: bash http-probe.sh https://example.com\n' >&2
  exit 2
fi
case "$1" in
  https://*) ;;
  *) printf 'Provide an https:// URL.\n' >&2; exit 2 ;;
esac
curl --proto '=https' --connect-timeout 5 --max-time 15 --silent --show-error   --output /dev/null   --write-out 'HTTP %{http_code}\nConnect %{time_connect}s\nTLS %{time_appconnect}s\nTotal %{time_total}s\n'   --url "$1"
