← back to Parked Landers
status.sh
20 lines
#!/bin/bash
# Runs ON Mac2 (Steve: `! ~/pl-status.sh`). Pin down the 301/redirect + conf state.
ssh root@45.61.58.125 'bash -s' <<"REOF"
echo "=== redirect target (protectyourspec, http + https) ==="
curl -sI http://protectyourspec.com/ 2>/dev/null | grep -iE "^HTTP/|^location"
curl -skI https://protectyourspec.com/ 2>/dev/null | grep -iE "^HTTP/|^location"
echo
echo "=== our per-domain conf (protectyourspec) — mangled by certbot? ==="
cat /etc/nginx/sites-available/protectyourspec.com.conf 2>/dev/null
echo
echo "=== is our conf enabled? ==="
ls -la /etc/nginx/sites-enabled/ | grep -E "protectyourspec|cannabis|mymemo" || echo "(our confs NOT in sites-enabled!)"
echo
echo "=== catch-all / default redirects among enabled confs ==="
grep -rnE "default_server|return 301|rewrite .*permanent" /etc/nginx/sites-enabled/ 2>/dev/null | grep -v "parked-landers" | head -15
echo
echo "=== acme webroot dir present? ==="
ls -ld /var/www/certbot 2>/dev/null || echo "NO /var/www/certbot"
REOF