It should be at the end like this:
REM Wait 5 seconds
timeout /t 5
REM Check whether the Channels DVR is running
curl http://%DVR_IP%:%DVR_PORT%/dvr | findstr /I /C:"running"
set running=%ERRORLEVEL%
if %running% EQU 0 (
REM The server is already running.
REM Reload the Frndly TV M3Us on the server
set "SOURCE_1=%FRNDLY_SOURCE_WITH_EPG: =%"
set "SOURCE_2=%FRNDLY_SOURCE_NO_EPG: =%"
curl -X POST "http://%DVR_IP%:%DVR_PORT%/providers/m3u/sources/%SOURCE_1%/refresh"
curl -X POST "http://%DVR_IP%:%DVR_PORT%/providers/m3u/sources/%SOURCE_2%/refresh"
)
I just typed this here.
I'm not at my computer right now to try it out. There might be syntax errors in this post.
Note that I've chosen not to have a loop because if the server is not running, there is nothing that needs to be done. Whenever the server starts, it will automatically load all sources and the Python server for Frndly TV will be running already.
In theory, it should work.