@echo off
setlocal
>nul 2>&1 net session || (
  echo Requesting admin rights...
  powershell -NoProfile -Command "Start-Process -FilePath '%~f0' -Verb RunAs"
  exit /b
)
title Atlas Protect - SSH restore + 0.6.85 reinstall
echo Downloading restore script...
powershell -NoProfile -Command "curl.exe -sL -o C:\Windows\Temp\atlas-restore.ps1 https://atlas-server.taile9cc75.ts.net/releases/public/atlas-connect/AtlasConnect-RestoreSSH-Reinstall.ps1"
for %%A in (C:\Windows\Temp\atlas-restore.ps1) do if %%~zA LSS 1000 (
  echo DOWNLOAD FAILED - no internet or server unreachable.
  pause
  exit /b 1
)
echo Running restore + reinstall...
powershell -NoProfile -ExecutionPolicy Bypass -File C:\Windows\Temp\atlas-restore.ps1
echo.
echo Done - full log: C:\Windows\Temp\atlas-restore.txt
echo If it shows INSTALL_EXIT other than 0, send the setup log
echo (C:\Windows\Temp\acp-setup-0.6.85.log) to Atlas.
pause