#!/bin/bash
IP=24.183.131.174
curl -g -sk -m 10 "https://$IP/" > /tmp/bt_page.html
echo "== assets =="
grep -oiE '(src|href)="[^"]+"' /tmp/bt_page.html | sort -u | head -20
echo "== title/company =="
grep -oiE '<title>[^<]*' /tmp/bt_page.html | head -1
echo "== css/js head =="
grep -oiE '/[a-z0-9_/.-]+\.(css|js)' /tmp/bt_page.html | sort -u | head -10
echo "== fetch a static asset status =="
for p in favicon.ico static/app.js static/main.css style.css; do
  code=$(curl -g -sk -o /dev/null -w '%{http_code}' -m 8 "https://$IP/$p")
  echo "$p -> $code"
done
