You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
12 lines
1.0 KiB
12 lines
1.0 KiB
@echo off |
|
rem dsh-memory - stop bridge (graceful via /shutdown) and clean up leftover dsh headless processes |
|
setlocal |
|
set "ROOT=%~dp0.." |
|
|
|
powershell -NoProfile -ExecutionPolicy Bypass -Command ^ |
|
"$cfgPath = Join-Path (Split-Path -Parent '%~dp0') 'bridge\config.json';" ^ |
|
"try { $cfg = Get-Content $cfgPath -Raw -Encoding UTF8 | ConvertFrom-Json; $port = if ($cfg.port) { $cfg.port } else { 8766 }; Invoke-RestMethod -Method Post -Uri ('http://127.0.0.1:' + $port + '/shutdown') -Headers @{ Authorization = ('Bearer ' + $cfg.token) } -TimeoutSec 5 | Out-Null; Write-Host '[dsh-memory] bridge stopped.' } catch { Write-Host '[dsh-memory] bridge not reachable (already stopped?)' };" ^ |
|
"$dsh = Get-CimInstance Win32_Process -Filter \"Name='node.exe'\" | Where-Object { $_.CommandLine -like '*@deepseek-ai*dsh*bin.js*--profile headless*' };" ^ |
|
"foreach ($p in $dsh) { Write-Host ('[dsh-memory] killing leftover dsh headless pid ' + $p.ProcessId); Stop-Process -Id $p.ProcessId -Force -ErrorAction SilentlyContinue }" |
|
|
|
endlocal
|
|
|