-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathentrypoint.sh
40 lines (32 loc) · 1.24 KB
/
entrypoint.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/bash
# Start cron in the background
service cron start
# Add transcodessh user to the group that owns renderD128
# This is required, because unlike video the render group is different on each machine and often isn't setup
renderD128_gid=$(stat -c "%g" /dev/dri/renderD128)
groupadd --gid "$renderD128_gid" render
usermod -a -G render transcodessh
#this prevents files/subdirectories from being created that are unreachable by remote rffmpeg workers without root (IE. ensures 'users' group has access)
umask 002
# rffmpeg setup ------
# Ensure the /rffmpeg directory exists
mkdir -p /rffmpeg
# Copy rffmpeg.yml from the temporary location to the volume if it doesn't exist
if [ ! -f /rffmpeg/rffmpeg.yml ]; then
cp /tmp/rffmpeg/rffmpeg.yml /rffmpeg/rffmpeg.yml
fi
# Ensure the /etc/rffmpeg directory exists
mkdir -p /etc/rffmpeg
# Link config volume location to runtime location for rffmpeg
ln -s /rffmpeg/rffmpeg.yml /etc/rffmpeg/rffmpeg.yml
# if rffmpeg db exists then clear, if not init
if [ -f /rffmpeg/rffmpeg.db ]; then
rffmpeg clear
else
/usr/local/bin/rffmpeg init -y
fi
#------
# Start Jellyfin
/jellyfin/jellyfin --datadir /config --cachedir /cache --ffmpeg /usr/local/bin/ffmpeg &
#Wait for Jellyfin to finish or Sigterm
wait $!