Checkpoint working Muninn OBS discovery state
This commit is contained in:
parent
999fa55e25
commit
3edceb7f3a
4 changed files with 127 additions and 12 deletions
|
|
@ -6,6 +6,7 @@ param(
|
|||
[string] $LogRoot = "C:\Meta\Odin\logs\muninn",
|
||||
[int] $MaxStoreAgeSeconds = 180,
|
||||
[string] $IdunnRudpHealth = "10.77.0.2:17870",
|
||||
[string] $CaptureCommandRudpBind = "0.0.0.0:17883",
|
||||
[int] $ConnectTimeoutSeconds = 10,
|
||||
[string] $SshUser = "",
|
||||
[string] $IdentityFile = ""
|
||||
|
|
@ -97,7 +98,6 @@ if (-not (Test-Path -LiteralPath "$MuninnExe")) {
|
|||
`$muninnDir = Split-Path -Parent "$MuninnExe"
|
||||
`$taskExpectations = @(
|
||||
@{ Name = "GameCult-Muninn"; Launcher = "powershell"; Vbs = Join-Path `$muninnDir "start-muninn-serve-hidden.vbs"; Ps = Join-Path `$muninnDir "start-muninn-serve.ps1" },
|
||||
@{ Name = "GameCult-Muninn-Activate"; Launcher = "wscript"; Vbs = Join-Path `$muninnDir "activate-raven-av-srt-hidden.vbs"; Ps = Join-Path `$muninnDir "activate-raven-av-srt.ps1" },
|
||||
@{ Name = "GameCult-Muninn-VideoProof"; Launcher = "wscript"; Vbs = Join-Path `$muninnDir "muninn-raven-video-to-starfire-obs-hidden.vbs"; Ps = Join-Path `$muninnDir "muninn-raven-video-to-starfire-obs.ps1" }
|
||||
)
|
||||
foreach (`$expectation in `$taskExpectations) {
|
||||
|
|
@ -172,6 +172,9 @@ foreach (`$expectation in `$taskExpectations) {
|
|||
throw "`$(`$expectation.Vbs) does not reference a PowerShell launcher"
|
||||
}
|
||||
}
|
||||
if (Get-ScheduledTask -TaskName "GameCult-Muninn-Activate" -ErrorAction SilentlyContinue) {
|
||||
throw "Obsolete GameCult-Muninn-Activate task is still present on Raven"
|
||||
}
|
||||
`$servePidPath = Join-Path "$LogRoot" "muninn-serve.pid"
|
||||
`$servePid = `$null
|
||||
if (Test-Path -LiteralPath `$servePidPath) {
|
||||
|
|
@ -197,7 +200,7 @@ if (`$null -eq `$process) {
|
|||
foreach (`$pattern in @(
|
||||
"--host raven",
|
||||
"--activate-store $ActivateStorePath",
|
||||
"--capture-command-rudp-bind 0.0.0.0:17883",
|
||||
"--capture-command-rudp-bind $CaptureCommandRudpBind",
|
||||
"--idunn-rudp-health $IdunnRudpHealth",
|
||||
"--idunn-daemon muninn",
|
||||
"--idunn-health-contract muninn.cultnet-rudp-remote-telemetry-health"
|
||||
|
|
|
|||
|
|
@ -801,6 +801,11 @@ foreach (`$path in @(
|
|||
}
|
||||
}
|
||||
|
||||
`$obsoleteActivateTask = Get-ScheduledTask -TaskName "GameCult-Muninn-Activate" -ErrorAction SilentlyContinue
|
||||
if (`$null -ne `$obsoleteActivateTask) {
|
||||
Unregister-ScheduledTask -TaskName "GameCult-Muninn-Activate" -Confirm:`$false | Out-Null
|
||||
}
|
||||
|
||||
Get-CimInstance Win32_Process |
|
||||
Where-Object { `$_.Name -like "muninn*.exe" } |
|
||||
ForEach-Object {
|
||||
|
|
@ -893,11 +898,9 @@ function Assert-HiddenPowerShellTask {
|
|||
}
|
||||
|
||||
Register-HiddenPowerShellTask -TaskName "GameCult-Muninn" -PsPath "$servePsPath"
|
||||
Register-HiddenVbsTask -TaskName "GameCult-Muninn-Activate" -VbsPath "$activateVbsPath"
|
||||
Register-HiddenVbsTask -TaskName "GameCult-Muninn-VideoProof" -VbsPath "$videoProofVbsPath"
|
||||
|
||||
Assert-HiddenPowerShellTask -TaskName "GameCult-Muninn" -PsPath "$servePsPath"
|
||||
Assert-HiddenVbsTask -TaskName "GameCult-Muninn-Activate" -VbsPath "$activateVbsPath" -PsPath "$activatePsPath"
|
||||
Assert-HiddenVbsTask -TaskName "GameCult-Muninn-VideoProof" -VbsPath "$videoProofVbsPath" -PsPath "$videoProofPsPath"
|
||||
|
||||
Start-ScheduledTask -TaskName "GameCult-Muninn"
|
||||
|
|
@ -949,13 +952,35 @@ $restartExit = $LASTEXITCODE
|
|||
if ($restartExit -eq 0) {
|
||||
Start-Sleep -Seconds 2
|
||||
$healthScript = Join-Path $PSScriptRoot "health-muninn.ps1"
|
||||
& powershell.exe -NoProfile -ExecutionPolicy Bypass -File $healthScript `
|
||||
-RavenHost $RavenHost `
|
||||
-MuninnExe $MuninnExe `
|
||||
-StorePath $StorePath `
|
||||
-ConnectTimeoutSeconds $ConnectTimeoutSeconds `
|
||||
-MaxStoreAgeSeconds ([Math]::Max(180, $ServeStartTimeoutSeconds + 60)) `
|
||||
-SshUser $SshUser `
|
||||
-IdentityFile $IdentityFile
|
||||
$healthArgs = @(
|
||||
"-NoProfile",
|
||||
"-ExecutionPolicy",
|
||||
"Bypass",
|
||||
"-File",
|
||||
$healthScript,
|
||||
"-RavenHost",
|
||||
$RavenHost,
|
||||
"-MuninnExe",
|
||||
$MuninnExe,
|
||||
"-StorePath",
|
||||
$StorePath,
|
||||
"-ActivateStorePath",
|
||||
$ActivateStorePath,
|
||||
"-IdunnRudpHealth",
|
||||
$IdunnRudpHealth,
|
||||
"-CaptureCommandRudpBind",
|
||||
$CaptureCommandRudpBind,
|
||||
"-ConnectTimeoutSeconds",
|
||||
$ConnectTimeoutSeconds.ToString(),
|
||||
"-MaxStoreAgeSeconds",
|
||||
([Math]::Max(180, $ServeStartTimeoutSeconds + 60)).ToString()
|
||||
)
|
||||
if (-not [string]::IsNullOrWhiteSpace($SshUser)) {
|
||||
$healthArgs += @("-SshUser", $SshUser)
|
||||
}
|
||||
if (-not [string]::IsNullOrWhiteSpace($IdentityFile)) {
|
||||
$healthArgs += @("-IdentityFile", $IdentityFile)
|
||||
}
|
||||
& powershell.exe @healthArgs
|
||||
}
|
||||
exit $restartExit
|
||||
|
|
|
|||
Loading…
Reference in a new issue