#!/bin/bash
echo '=== listen ==='
grep -n listen /etc/nginx/sites-enabled/wifi-otantik /etc/nginx/sites-enabled/otantik_pay
echo '=== local titles ==='
for h in wifi.otantikhub.com business.otantikhub.com pay.otantikhub.com otantikhub.com portal.otantikhub.com; do
  t=$(curl -s -H "Host: $h" http://127.0.0.1/ | grep -o '<title>[^<]*' | head -1)
  echo "$h $t"
done
echo '=== recover ==='
curl -s -H 'Host: pay.otantikhub.com' http://127.0.0.1/recuperer | grep -o '<title>[^<]*'
echo DONE
