24 lines
553 B
Batchfile
24 lines
553 B
Batchfile
@echo off
|
|
setlocal
|
|
|
|
cd /d "%~dp0"
|
|
|
|
set "LOG_DIR=%~dp0logs"
|
|
set "LOG_FILE=%LOG_DIR%\autostart.log"
|
|
set "DOCUTRANSLATE_NONINTERACTIVE=1"
|
|
|
|
if not exist "%LOG_DIR%" mkdir "%LOG_DIR%"
|
|
|
|
:restart
|
|
echo.>> "%LOG_FILE%"
|
|
echo [%DATE% %TIME%] Starting DocuTranslate autostart runner...>> "%LOG_FILE%"
|
|
|
|
call "%~dp0run.bat" >> "%LOG_FILE%" 2>&1
|
|
|
|
set "EXIT_CODE=%ERRORLEVEL%"
|
|
echo [%DATE% %TIME%] DocuTranslate stopped with exit code %EXIT_CODE%.>> "%LOG_FILE%"
|
|
echo [%DATE% %TIME%] Restarting in 10 seconds...>> "%LOG_FILE%"
|
|
|
|
timeout /t 10 /nobreak >nul
|
|
goto restart
|