33 lines
1.1 KiB
PowerShell
33 lines
1.1 KiB
PowerShell
# PowerShell скрипт для остановки BGP сервера
|
|
|
|
Write-Host "=== Stopping BGP Server ===" -ForegroundColor Yellow
|
|
|
|
# Проверка что контейнер запущен
|
|
$containerStatus = docker ps --filter name=bgp-server --format "{{.Status}}"
|
|
if (!$containerStatus) {
|
|
Write-Host "BGP server is not running" -ForegroundColor Yellow
|
|
exit 0
|
|
}
|
|
|
|
Write-Host "BGP server is running. Stopping..." -ForegroundColor Yellow
|
|
|
|
# Остановка контейнера
|
|
docker-compose down
|
|
|
|
if ($LASTEXITCODE -eq 0) {
|
|
Write-Host "✓ BGP server stopped successfully" -ForegroundColor Green
|
|
} else {
|
|
Write-Host "✗ Failed to stop BGP server" -ForegroundColor Red
|
|
exit 1
|
|
}
|
|
|
|
# Проверка что контейнер остановлен
|
|
$containerStatus = docker ps --filter name=bgp-server --format "{{.Status}}"
|
|
if (!$containerStatus) {
|
|
Write-Host "✓ Container is stopped" -ForegroundColor Green
|
|
} else {
|
|
Write-Host "✗ Container is still running" -ForegroundColor Red
|
|
exit 1
|
|
}
|
|
|
|
Write-Host "=== BGP Server Stopped ===" -ForegroundColor Green |