消息推送
This commit is contained in:
27
server/scripts/stop-delivery-backend.ps1
Normal file
27
server/scripts/stop-delivery-backend.ps1
Normal file
@@ -0,0 +1,27 @@
|
||||
$ErrorActionPreference = 'SilentlyContinue'
|
||||
|
||||
$root = Resolve-Path (Join-Path $PSScriptRoot "..\..")
|
||||
$pidsFile = Join-Path $root 'server\.runtime\delivery-backend.pids.json'
|
||||
|
||||
if (Test-Path $pidsFile) {
|
||||
try {
|
||||
$pids = Get-Content $pidsFile -Raw | ConvertFrom-Json
|
||||
foreach ($name in $pids.PSObject.Properties.Name) {
|
||||
$pid = [int]$pids.$name
|
||||
if ($pid -gt 0) {
|
||||
try {
|
||||
Stop-Process -Id $pid -Force
|
||||
Write-Host "Stopped $name PID=$pid"
|
||||
} catch {
|
||||
Write-Host "Failed to stop $name PID=$pid"
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch {
|
||||
Write-Host "Failed to parse $pidsFile"
|
||||
}
|
||||
} else {
|
||||
Write-Host "No pid file found: $pidsFile"
|
||||
}
|
||||
|
||||
Write-Host "If ports still occupied, run: netstat -ano | Select-String ':7201 ' / ':7301 '"
|
||||
Reference in New Issue
Block a user