#!/bin/bash
# Keep dashboard server running - more robust

while true; do
    if ! lsof -i :8080 > /dev/null 2>&1; then
        cd /home/wkmabra/.openclaw/workspace
        python3 -m http.server 8080 --bind 0.0.0.0 >> /tmp/dashboard.log 2>&1 &
        echo "$(date): Restarted dashboard server" >> /tmp/dashboard.log
    fi
    sleep 5
done
