23 lines
774 B
PowerShell
23 lines
774 B
PowerShell
if (Test-Path "vault.pid") {
|
|
$vaultPid = Get-Content "vault.pid"
|
|
Write-Host "Stopping Vault process $vaultPid"
|
|
Stop-Process -Id $vaultPid -Force
|
|
Remove-Item "vault-pid" -Force
|
|
} else {
|
|
Write-Host "No PID file found, Vault may not have started."
|
|
}
|
|
|
|
# Function to display logs
|
|
if (Test-Path "vault.out.log") {
|
|
Write-Output "=== VAULT SERVER STDOUT (last 25 lines) ==="
|
|
Get-Content "vault.out.log" -ErrorAction SilentlyContinue | Select-Object -Last 25
|
|
} else {
|
|
Write-Output "No Vault output log found!"
|
|
}
|
|
if (Test-Path "vault.err.log") {
|
|
Write-Output "=== VAULT SERVER STDERR (last 25 lines) ==="
|
|
Get-Content "vault.err.log" -ErrorAction SilentlyContinue | Select-Object -Last 25
|
|
} else {
|
|
Write-Output "No Vault error log found!"
|
|
}
|