@echo off
setlocal
cd /d "%~dp0"
echo Testando leitor de placas local...
powershell -NoProfile -ExecutionPolicy Bypass -Command "try { $r=Invoke-RestMethod -Uri 'http://127.0.0.1:8790/status' -TimeoutSec 5; $r | ConvertTo-Json -Depth 6; if($r.ok){Write-Host ''; Write-Host 'LEITOR DE PLACAS ONLINE.' -ForegroundColor Green}else{exit 1} } catch { Write-Host ''; Write-Host ('LEITOR DE PLACAS OFFLINE: '+$_.Exception.Message) -ForegroundColor Red; exit 1 }"
echo.
pause
