diff --git a/get-whishper.bat b/get-whishper.bat new file mode 100644 index 0000000..765025e --- /dev/null +++ b/get-whishper.bat @@ -0,0 +1,65 @@ +@echo off +rem Script by @johnwayne087, see: https://github.com/pluja/whishper/issues/18#issuecomment-1724095055 + +rem Check if Docker is installed +docker --version >nul 2>&1 +if %errorlevel% neq 0 ( + echo Docker is not installed. Please install Docker first. + goto :EOF +) + +rem Ask for setup directory +echo Do you want to set up everything in the current directory? (Y/N) +set /p answer= +if /i "%answer%"=="Y" ( + echo Setting up everything in the current directory +) else ( + echo Enter the name of the directory where you want to set up everything: + set /p directory= + echo Setting up everything in the %directory% directory + md "%directory%" + cd "%directory%" +) + +rem Get docker-compose.yml +echo Getting the docker-compose.yml file from Github +curl -o docker-compose.yml https://raw.githubusercontent.com/pluja/whishper/main/docker-compose.yml + +rem Get nginx.conf +echo Getting the nginx.conf file from Github +curl -o nginx.conf https://raw.githubusercontent.com/pluja/whishper/main/nginx.conf + +rem Get .env file +if exist .env ( + echo .env file already exists + echo Do you want to overwrite it? (Y/N) + set /p answer= + if /i "%answer%"=="Y" ( + echo Copying env.example to .env + curl -o .env https://raw.githubusercontent.com/pluja/whishper/main/example.env + ) +) else ( + echo Getting the default .env file from Github + curl -o .env https://raw.githubusercontent.com/pluja/whishper/main/example.env +) + +rem Create directories +echo Creating necessary directories for libretranslate +md whishper_data\libretranslate\data +md whishper_data\libretranslate\cache + +rem Pull images +echo Do you want to pull docker images? (Y/N) +set /p answer= +if /i "%answer%"=="Y" ( + echo Pulling docker images + docker-compose pull +) + +rem Start containers +echo Do you want to start the containers? (Y/N) +set /p answer= +if /i "%answer%"=="Y" ( + echo Starting whishper... + docker-compose up -d +) \ No newline at end of file