Add Muninn Quest access surface
This commit is contained in:
parent
d1b3bd3127
commit
d5345e5875
8 changed files with 492 additions and 6 deletions
2
scripts/health-starfire-muninn.cmd
Normal file
2
scripts/health-starfire-muninn.cmd
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
@echo off
|
||||
powershell.exe -NoProfile -ExecutionPolicy Bypass -File E:\Projects\Odin\scripts\health-starfire-muninn.ps1
|
||||
30
scripts/health-starfire-muninn.ps1
Normal file
30
scripts/health-starfire-muninn.ps1
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
param(
|
||||
[string] $MuninnExe = "C:\Meta\Odin\Muninn\muninn.exe",
|
||||
[string] $StorePath = "C:\Meta\Odin\state\starfire.muninn.telemetry.cc"
|
||||
)
|
||||
|
||||
$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"
|
||||
}
|
||||
|
||||
& $MuninnExe --health --store $StorePath
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
exit $LASTEXITCODE
|
||||
}
|
||||
|
||||
& $MuninnExe quest-access-status --store $StorePath
|
||||
exit $LASTEXITCODE
|
||||
2
scripts/restart-starfire-muninn.cmd
Normal file
2
scripts/restart-starfire-muninn.cmd
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
@echo off
|
||||
powershell.exe -NoProfile -ExecutionPolicy Bypass -File E:\Projects\Odin\scripts\restart-starfire-muninn.ps1
|
||||
53
scripts/restart-starfire-muninn.ps1
Normal file
53
scripts/restart-starfire-muninn.ps1
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
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"
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
if (-not (Test-Path -LiteralPath $MuninnExe)) {
|
||||
throw "Muninn executable not found at $MuninnExe"
|
||||
}
|
||||
|
||||
Get-CimInstance Win32_Process |
|
||||
Where-Object {
|
||||
$_.Name -ieq "muninn.exe" -and
|
||||
$_.CommandLine -like "*serve*" -and
|
||||
$_.CommandLine -like "*--host*starfire*"
|
||||
} |
|
||||
ForEach-Object {
|
||||
& taskkill.exe /PID $_.ProcessId /T /F | Out-Null
|
||||
}
|
||||
|
||||
New-Item -ItemType Directory -Force -Path $LogRoot | Out-Null
|
||||
$storeParent = Split-Path -Parent $StorePath
|
||||
if (-not [string]::IsNullOrWhiteSpace($storeParent)) {
|
||||
New-Item -ItemType Directory -Force -Path $storeParent | Out-Null
|
||||
}
|
||||
|
||||
$arguments = @(
|
||||
"serve",
|
||||
"--store", $StorePath,
|
||||
"--log-root", $LogRoot,
|
||||
"--host", "starfire",
|
||||
"--interval-seconds", "15",
|
||||
"--quest-adb",
|
||||
"--quest-serial", $QuestSerial
|
||||
)
|
||||
|
||||
$process = Start-Process `
|
||||
-FilePath $MuninnExe `
|
||||
-ArgumentList $arguments `
|
||||
-WindowStyle Hidden `
|
||||
-PassThru `
|
||||
-RedirectStandardOutput (Join-Path $LogRoot "muninn-serve.out.log") `
|
||||
-RedirectStandardError (Join-Path $LogRoot "muninn-serve.err.log")
|
||||
|
||||
$process.Id | Set-Content -Encoding ASCII -LiteralPath (Join-Path $LogRoot "muninn-serve.pid")
|
||||
|
||||
Start-Sleep -Seconds 2
|
||||
& powershell.exe -NoProfile -ExecutionPolicy Bypass -File (Join-Path $PSScriptRoot "health-starfire-muninn.ps1") `
|
||||
-MuninnExe $MuninnExe `
|
||||
-StorePath $StorePath
|
||||
Loading…
Reference in a new issue