Vili/scripts/restart-vili-daemon.ps1
Meta Vens 3778830df4 Vili: delete the unsigned Idunn RUDP health publisher
It published idunn.daemon_health to 10.77.0.2:17870 (the retired Windows Idunn)
every 15 s and failed each time; Idunn on Yggdrasil binds no RUDP health ingress.
Deletes idunn-rudp.cjs, the publisher and its status, the --idunn-* args in the
daemon and the three launcher scripts, operator_state slot 4, and the
cultnet-ts and direct @msgpack/msgpack dependencies. transportProfile now states
local-cultcache-only. All commits build (node --check passes); not yet run on Raven.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 05:12:00 +02:00

38 lines
1.3 KiB
PowerShell

param(
[int]$Port = 8824,
[string]$HostName = "0.0.0.0",
[string]$StateRoot = "E:\Projects\Vili\.vili"
)
$ErrorActionPreference = "Stop"
$ProgressPreference = "SilentlyContinue"
$PidPath = Join-Path $StateRoot "vili-daemon.pid"
$TaskName = "GameCult\Vili"
if (Test-Path $PidPath) {
$existingPid = (Get-Content $PidPath -ErrorAction SilentlyContinue | Select-Object -First 1)
if ($existingPid) {
$process = Get-Process -Id ([int]$existingPid) -ErrorAction SilentlyContinue
if ($process) {
Stop-Process -Id $process.Id -Force
Start-Sleep -Seconds 1
}
}
}
if (Get-ScheduledTask -TaskName "Vili" -TaskPath "\GameCult\" -ErrorAction SilentlyContinue) {
Stop-ScheduledTask -TaskName "Vili" -TaskPath "\GameCult\" -ErrorAction SilentlyContinue
Start-Sleep -Seconds 1
Start-ScheduledTask -TaskName "Vili" -TaskPath "\GameCult\"
Start-Sleep -Seconds 3
node (Join-Path (Split-Path -Parent $PSScriptRoot) "scripts\vili-daemon.mjs") --health --host 127.0.0.1 --port $Port --state-root $StateRoot
if ($LASTEXITCODE -ne 0) {
throw "Vili scheduled task started but health check failed."
}
Write-Host "Vili restarted through scheduled task $TaskName"
} else {
& (Join-Path $PSScriptRoot "start-vili-daemon.ps1") `
-Port $Port `
-HostName $HostName `
-StateRoot $StateRoot
}