- scripts/start_server.ps1: 기존 프로세스 종료 후 시작 - scripts/stop_server.ps1: 서버 중지 - scripts/*.bat: 더블클릭 실행용
16 lines
547 B
PowerShell
16 lines
547 B
PowerShell
# stop_server.ps1 - Flask 서버 중지 스크립트
|
|
|
|
$PORT = 7001
|
|
|
|
Write-Host "=== 청춘약국 마일리지 서버 중지 ===" -ForegroundColor Cyan
|
|
|
|
$netstat = netstat -ano | Select-String ":$PORT.*LISTENING"
|
|
if ($netstat) {
|
|
$pid = ($netstat -split '\s+')[-1]
|
|
Write-Host "서버 프로세스 종료 중 (PID: $pid)..." -ForegroundColor Yellow
|
|
taskkill /F /PID $pid 2>$null
|
|
Write-Host "=== 서버 중지 완료 ===" -ForegroundColor Green
|
|
} else {
|
|
Write-Host "실행 중인 서버가 없습니다." -ForegroundColor Yellow
|
|
}
|