Odin/scripts/health-starfire-muninn.ps1
2026-06-16 00:07:55 +01:00

48 lines
1.3 KiB
PowerShell

param(
[string] $MuninnExe = "C:\Meta\Odin\Muninn\muninn.exe",
[string] $StorePath = "C:\Meta\Odin\state\starfire.muninn.telemetry.cc",
[string[]] $MoveState = @(),
[int] $IntervalSeconds = 15,
[string] $IdunnRudpHealth = "127.0.0.1:17870"
)
$ErrorActionPreference = "Stop"
if (-not (Test-Path -LiteralPath $MuninnExe)) {
throw "Muninn executable not found at $MuninnExe"
}
$process = Get-CimInstance Win32_Process |
Where-Object {
$_.Name -ieq "muninn.exe" -and
$_.CommandLine -like "*serve*" -and
$_.CommandLine -like "*--host*starfire*" -and
$_.CommandLine -like "*--quest-adb*"
} |
Select-Object -First 1
if ($null -eq $process) {
throw "Starfire Muninn serve process is not running with Quest access enabled"
}
$healthArgs = @(
"--health",
"--store", $StorePath,
"--host", "starfire",
"--interval-seconds", "$IntervalSeconds",
"--idunn-rudp-health", $IdunnRudpHealth,
"--idunn-daemon", "starfire-muninn",
"--idunn-health-contract", "muninn.cultnet-rudp-local-telemetry-and-quest-access"
)
foreach ($source in $MoveState) {
if (-not [string]::IsNullOrWhiteSpace($source)) {
$healthArgs += @("--move-state", $source)
}
}
& $MuninnExe @healthArgs
if ($LASTEXITCODE -ne 0) {
exit $LASTEXITCODE
}
& $MuninnExe quest-access-status --store $StorePath
exit $LASTEXITCODE