#!/bin/bash # WEVIA Page Regression Scanner — detects blank/broken pages LOG="/var/log/wevia-page-scan.log" echo "$(date): PAGE SCAN START" >> $LOG PAGES="https://weval-consulting.com/openclaw.html https://code.weval-consulting.com / /use-cases.html /wevia.html /l99.html /l99-saas.html /blade-ai.html /admin.html /realtime-monitor.html /architecture.html /sovereign-claude.html /l99-brain.html /l99-fullscreen.html /claw-code/" FAIL=0 for P in $PAGES; do CODE=$(curl -sf -o /tmp/page-check.html -w "%{http_code}" "https://weval-consulting.com$P" --max-time 8 2>/dev/null) SIZE=$(wc -c < /tmp/page-check.html 2>/dev/null || echo 0) TITLE=$(grep -o '[^<]*' /tmp/page-check.html 2>/dev/null | head -1) BLANK=0 # Detect blank pages (< 500 bytes of content) BODY=$(grep -o ']*>.*' /tmp/page-check.html 2>/dev/null | wc -c) [ "$SIZE" -lt 500 ] && BLANK=1 [ "$CODE" != "200" ] && [ "$CODE" != "302" ] && BLANK=1 # Check for common error patterns grep -qi "File not found\|500 Internal\|502 Bad\|404 Not Found\|Unexpected token\|is not valid JSON" /tmp/page-check.html 2>/dev/null && BLANK=1 if [ "$BLANK" -eq 1 ]; then echo "$(date +%H:%M) FAIL: $P HTTP:$CODE SIZE:${SIZE}B" >> $LOG FAIL=$((FAIL+1)) fi done echo "$(date): DONE — $FAIL failures" >> $LOG # Save as JSON for dashboard echo "{"ts":"$(date +%H:%M)","pages":$(echo $PAGES | wc -w),"fail":$FAIL}" > /var/www/html/api/wevia-page-scan.json