← back to Parked Landers
diag.sh
23 lines
#!/bin/bash
# Runs ON Mac2 (Steve: `! bash ~/Projects/parked-landers/diag.sh`). READ-ONLY diagnosis.
ssh root@45.61.58.125 'bash -s' <<"REOF"
DOMS="protectyourspec.com cannabisofthemonthclub.com hempofthemonthclub.com marijuanaofthemonthclub.com potofthemonthclub.com weedofthemonthclub.com mymemosamples.com hospitalitysalesrepresentatives.com"
echo "=== every /etc/nginx file that names each domain (file:line) ==="
for d in $DOMS; do
echo "--- $d ---"
grep -rn "$d" /etc/nginx 2>/dev/null | grep -i "server_name"
done
echo
echo "=== our parked confs in sites-enabled ==="
ls -la /etc/nginx/sites-enabled/ | grep -iE "protectyourspec|cannabis|hemp|marijuana|potofthe|weedofthe|mymemo|hospitalitysales" || echo "(none found — our confs missing?)"
echo
echo "=== certbot result lines from the deploy run ==="
grep -E "cert ok|certbot FAILED" /tmp/deploy-remote.log 2>/dev/null || echo "(no cert lines in log)"
echo
echo "=== last Let's Encrypt errors (rate limit / challenge fails?) ==="
grep -iE "error|too many|rate limit|no valid|failed" /var/log/letsencrypt/letsencrypt.log 2>/dev/null | tail -10 || echo "(no letsencrypt log)"
echo
echo "=== what serves protectyourspec.com right now (root dir of winning block) ==="
grep -rn -A8 "server_name[^;]*protectyourspec" /etc/nginx 2>/dev/null | grep -iE "root|server_name|listen" | head -12
REOF