Files
mtusi2026lab4/scripts/stop-one.cmd
T

12 lines
306 B
Batchfile

@echo off
if "%TARGET_INSTANCE_ID%"=="" exit /b 2
cd /d "%~dp0.."
for /f %%i in ('docker compose ps -q api') do (
echo %%i| findstr /b /i "%TARGET_INSTANCE_ID%" >nul && (
docker stop -t 10 %%i >nul
exit /b 0
)
)
echo no running api replica matches TARGET_INSTANCE_ID 1>&2
exit /b 1