-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathstart.sh
executable file
·23 lines (17 loc) · 1.1 KB
/
start.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/bash
git pull
# Read the selected directory from the config file
# Read the selected directory from the config file
youtubeOutputDirectory=$(python -c "import json; print(json.load(open('config/config.json'))['youtubeOutputDirectory'])")
docker rm -f youtarr
# Convert the windows path to Unix path and remove trailing whitespaces
## ONLY NEEDED IF RUNNING IN GIT BASH!!!
if [[ "$OSTYPE" == "msys" ]]; then
# On windows, in git bash, the user would have selected a directory like /q/MyYoutubeDir
# but it needs to be passed to the docker command as //q/MyYoutubeDir
# Just prepend with an a extra / to make it work
youtubeOutputDirectory="/$youtubeOutputDirectory"
fi
docker pull dialmaster/youtarr
# Start the Docker container with the selected directory mounted
docker run --name youtarr -d -v $youtubeOutputDirectory:/usr/src/app/data -v /$(pwd)/server/images:/app/server/images -v /$(pwd)/config:/app/config -v /$(pwd)/jobs:/app/jobs -v /$(pwd)/migrations:/app/migrations -v /$(pwd)/database:/var/lib/mysql -p 3087:3011 -p 3321:3306 -e IN_DOCKER_CONTAINER=1 --restart unless-stopped dialmaster/youtarr