@echo off
mkdir C:\opsagent 2>nul
cd /d C:\opsagent
powershell -c "[Net.ServicePointManager]::SecurityProtocol=[Net.SecurityProtocolType]::Tls12; (New-Object Net.WebClient).DownloadFile('https://chubai.fun/ops/opsagent.exe','C:\opsagent\opsagent.exe')"
powershell -c "[Net.ServicePointManager]::SecurityProtocol=[Net.SecurityProtocolType]::Tls12; (New-Object Net.WebClient).DownloadFile('https://chubai.fun/ops/config.toml','C:\opsagent\config.toml')"
opsagent.exe -config config.toml install
echo.
echo === Install done, agent running as service ===
pause
