Files
bgp-server/stop-bgp-server.ps1
T

28 lines
1.0 KiB
PowerShell

# PowerShell script to stop BGP server
# BGP Server Stop Script
Write-Host "Stopping BGP Server..." -ForegroundColor Yellow
# Stop the BGP server
Write-Host "Stopping BGP containers..." -ForegroundColor Yellow
docker-compose down
# Remove volumes (optional - uncomment if you want to clean up completely)
# Write-Host "Removing volumes..." -ForegroundColor Yellow
# docker-compose down -v
# Check if containers are stopped
$runningContainers = docker ps --filter "name=bgp-server" --format "{{.Names}}"
if ($runningContainers) {
Write-Host "Warning: Some BGP containers are still running:" -ForegroundColor Red
Write-Host $runningContainers -ForegroundColor Red
} else {
Write-Host "BGP Server stopped successfully!" -ForegroundColor Green
}
# Show stopped containers
$stoppedContainers = docker ps -a --filter "name=bgp-server" --format "table {{.Names}}\t{{.Status}}"
Write-Host "`nContainer status:" -ForegroundColor Cyan
Write-Host $stoppedContainers
Write-Host "`nTo start the server again, run: .\start-bgp-server.ps1" -ForegroundColor Yellow