Files
John 69b4e68baf
SAP-ERP Portal CI/CD / build (push) Failing after 5m20s
first commit
2026-09-23 17:31:02 +05:30

25 lines
1.1 KiB
Batchfile

@echo off
rem ==================================================================
rem Shows whether the portal is running and on which port.
rem Port is read from .env (PORT=...), default 5000.
rem ==================================================================
set "PORT=5000"
if exist "%~dp0..\.env" (
for /f "tokens=2 delims==" %%P in ('findstr /b /i "PORT=" "%~dp0..\.env"') do set "PORT=%%P"
)
set "PORT=%PORT: =%"
echo === SAP-ERP Portal status (port %PORT%) ===
echo.
powershell -NoProfile -Command "$p = Get-CimInstance Win32_Process | Where-Object { $_.Name -eq 'node.exe' -and $_.CommandLine -match 'server\.js' }; if ($p) { $p | ForEach-Object { Write-Host ('RUNNING - node.exe PID ' + $_.ProcessId) } } else { Write-Host 'NOT RUNNING' }"
echo.
echo Listening on port %PORT%:
netstat -ano | findstr :%PORT% | findstr LISTENING
if %ERRORLEVEL% NEQ 0 echo (nothing listening on %PORT%)
echo.
echo Autostart task:
schtasks /Query /TN "SAP-ERP-Portal" 2>nul | findstr /I "SAP-ERP-Portal Ready Running"
if %ERRORLEVEL% NEQ 0 echo (autostart task not installed - run install-autostart.bat)
echo.
pause