diff --git a/scripts/health-starfire-muninn.ps1 b/scripts/health-starfire-muninn.ps1 index 955b98e..70ae789 100644 --- a/scripts/health-starfire-muninn.ps1 +++ b/scripts/health-starfire-muninn.ps1 @@ -1,6 +1,7 @@ param( [string] $MuninnExe = "C:\Meta\Odin\Muninn\muninn.exe", - [string] $StorePath = "C:\Meta\Odin\state\starfire.muninn.telemetry.cc" + [string] $StorePath = "C:\Meta\Odin\state\starfire.muninn.telemetry.cc", + [switch] $SkipUsbMoveLight ) $ErrorActionPreference = "Stop" @@ -27,4 +28,16 @@ if ($LASTEXITCODE -ne 0) { } & $MuninnExe quest-access-status --store $StorePath -exit $LASTEXITCODE +if ($LASTEXITCODE -ne 0) { + exit $LASTEXITCODE +} + +if (-not $SkipUsbMoveLight) { + $moveLightProcess = Get-Process -Name "Mimir.PsMoveProbe" -ErrorAction SilentlyContinue | + Select-Object -First 1 + if ($null -eq $moveLightProcess) { + throw "Starfire USB Move light worker is not running" + } +} + +exit 0 diff --git a/scripts/restart-starfire-muninn.ps1 b/scripts/restart-starfire-muninn.ps1 index fb605b9..e036bb4 100644 --- a/scripts/restart-starfire-muninn.ps1 +++ b/scripts/restart-starfire-muninn.ps1 @@ -2,7 +2,11 @@ param( [string] $MuninnExe = "C:\Meta\Odin\Muninn\muninn.exe", [string] $StorePath = "C:\Meta\Odin\state\starfire.muninn.telemetry.cc", [string] $LogRoot = "C:\Meta\Odin\logs\starfire-muninn", - [string] $QuestSerial = "1WMHHB68PG1515" + [string] $QuestSerial = "1WMHHB68PG1515", + [string] $MimirRepoPath = "E:\Projects\Mimir", + [string] $UsbMoveLightRgb = "#35ff6c", + [int] $UsbMoveLightRefreshMs = 200, + [switch] $SkipUsbMoveLight ) $ErrorActionPreference = "Stop" @@ -47,6 +51,17 @@ $process = Start-Process ` $process.Id | Set-Content -Encoding ASCII -LiteralPath (Join-Path $LogRoot "muninn-serve.pid") +if (-not $SkipUsbMoveLight) { + $moveLightScript = Join-Path $MimirRepoPath "scripts\start-starfire-move-light.ps1" + if (-not (Test-Path -LiteralPath $moveLightScript)) { + throw "Starfire USB Move light script not found at $moveLightScript" + } + & powershell.exe -NoProfile -ExecutionPolicy Bypass -File $moveLightScript ` + -Rgb $UsbMoveLightRgb ` + -RefreshMs $UsbMoveLightRefreshMs ` + -HoldSeconds 0 +} + Start-Sleep -Seconds 2 & powershell.exe -NoProfile -ExecutionPolicy Bypass -File (Join-Path $PSScriptRoot "health-starfire-muninn.ps1") ` -MuninnExe $MuninnExe `