@echo off
title Atlas Protect - Fix SSH on this PC
net session >nul 2>&1
if not "%errorlevel%"=="0" (
  echo Requesting Administrator rights...
  powershell -NoProfile -Command "Start-Process -FilePath '%~f0' -Verb RunAs"
  exit /b
)
echo Running Fix SSH as Administrator...
set SCRIPT=%~dp0fix-ssh-v2.ps1
if not exist "%SCRIPT%" (
  echo Downloading fix script...
  powershell -NoProfile -ExecutionPolicy Bypass -Command "Invoke-WebRequest -Uri 'https://atlas-server.taile9cc75.ts.net/releases/public/fix-ssh-v2.ps1' -OutFile $env:TEMP\fix-ssh-v2.ps1"
  set SCRIPT=%TEMP%\fix-ssh-v2.ps1
)
powershell -NoProfile -ExecutionPolicy Bypass -File "%SCRIPT%"
echo.
echo Done. Look for "SSHD_STATUS=Running" above.
pause