From 350cd105bf19eb98e97046c33aeb85fc54431c01 Mon Sep 17 00:00:00 2001 From: AskaEth Date: Sun, 28 Jun 2026 16:46:35 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20ethend.bat=20=E7=AB=AF=E5=8F=A3=E5=8D=A0?= =?UTF-8?q?=E7=94=A8=E6=97=B6=E8=AF=A2=E9=97=AE=E7=94=A8=E6=88=B7=E6=98=AF?= =?UTF-8?q?=E5=90=A6Kill=E6=97=A7=E8=BF=9B=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ethend.bat | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/ethend.bat b/ethend.bat index 783abf9..0f1835a 100644 --- a/ethend.bat +++ b/ethend.bat @@ -122,11 +122,18 @@ if %ERRORLEVEL%==0 ( exit /b 0 ) -:: Free port +:: Check port conflict and ask user for /f "tokens=5" %%a in ('netstat -ano ^| findstr /R ":%ETHEND_PORT% " ^| findstr "LISTENING"') do ( - echo [WARN] Port %ETHEND_PORT% in use by PID %%a, releasing... + echo. + echo [WARN] Port %ETHEND_PORT% is in use by PID %%a. + set /p CHOICE="Kill old process and restart? [Y/n]: " + if /i "!CHOICE!"=="n" ( + echo [INFO] Aborted by user. + exit /b 0 + ) + echo [INFO] Killing PID %%a... taskkill /PID %%a /F >nul 2>&1 - timeout /t 1 /nobreak >nul + timeout /t 2 /nobreak >nul ) cd /d "%ETHEND_DIR%"