mirror of
https://github.com/bunny-lab-io/Borealis.git
synced 2025-09-11 07:08:42 -06:00
Restructured Agent Deployment Code
This commit is contained in:
11
Data/Agent/Scripts/watchdog.ps1
Normal file
11
Data/Agent/Scripts/watchdog.ps1
Normal file
@@ -0,0 +1,11 @@
|
||||
param(
|
||||
[string]$SupervisorTaskName = 'Borealis Agent - Supervisor'
|
||||
)
|
||||
|
||||
$ErrorActionPreference = 'SilentlyContinue'
|
||||
$task = Get-ScheduledTask -TaskName $SupervisorTaskName -ErrorAction SilentlyContinue
|
||||
if (-not $task) { exit }
|
||||
$st = $task.State
|
||||
if ($st -eq 'Disabled') { Enable-ScheduledTask -TaskName $SupervisorTaskName | Out-Null }
|
||||
if ($st -ne 'Running') { Start-ScheduledTask -TaskName $SupervisorTaskName | Out-Null }
|
||||
|
Reference in New Issue
Block a user