diff --git a/ethend.bat b/ethend.bat index a64af94..9a4ca8d 100644 --- a/ethend.bat +++ b/ethend.bat @@ -117,16 +117,7 @@ if %DO_FRESH%==1 ( curl -s -X POST "http://localhost:%ETHEND_PORT%/api/services/start-all-fresh" >nul 2>&1 ) -:: Check if already running -curl -s -o nul "http://localhost:%ETHEND_PORT%/api/health" 2>nul -if %ERRORLEVEL%==0 ( - echo. - echo [OK] ethend already running: http://localhost:%ETHEND_PORT% - echo API: http://localhost:%ETHEND_PORT%/api/health - exit /b 0 -) - -:: Check port conflict +:: Check if port already in use set FOUND_PID= for /f "tokens=5" %%a in ('netstat -ano ^| findstr /R ":%ETHEND_PORT% " ^| findstr "LISTENING"') do set FOUND_PID=%%a if not "%FOUND_PID%"=="" ( @@ -135,6 +126,7 @@ if not "%FOUND_PID%"=="" ( set /p CHOICE="Kill old process and restart? [Y/n]: " if /i "!CHOICE!"=="n" ( echo [INFO] Aborted by user. + pause exit /b 0 ) echo [INFO] Killing PID %FOUND_PID%...