19 lines
760 B
Batchfile
19 lines
760 B
Batchfile
@echo off
|
|
:: Auto-elevate to admin
|
|
net session >nul 2>&1
|
|
if %errorLevel% neq 0 (
|
|
powershell -Command "Start-Process '%~f0' -Verb RunAs"
|
|
exit
|
|
)
|
|
title WEVAL Sentinel Watchdog v2
|
|
schtasks /Create /TN "WEVAL Sentinel Watchdog" /TR "\"%~f0\"" /SC ONLOGON /RL HIGHEST /F >nul 2>&1
|
|
|
|
:watchdog
|
|
echo [%date% %time%] Downloading latest sentinel-agent...
|
|
powershell -Command "Invoke-WebRequest -Uri 'https://weval-consulting.com/api/sentinel-agent-v2.3.ps1' -OutFile 'C:\ProgramData\WEVAL\sentinel-agent.ps1' -UseBasicParsing" 2>nul
|
|
echo [%date% %time%] Starting Sentinel Agent...
|
|
powershell -ExecutionPolicy Bypass -File "C:\ProgramData\WEVAL\sentinel-agent.ps1"
|
|
echo [%date% %time%] Sentinel exited. Restarting in 5s...
|
|
timeout /t 5 /nobreak >nul
|
|
goto watchdog
|