-
Notifications
You must be signed in to change notification settings - Fork 6
/
plex
92 lines (82 loc) · 3.33 KB
/
plex
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#!/bin/bash
############# https://github.com/plexguide/PlexGuide.com/graphs/contributors ###
plex () {
container_reset
# VARIABLES ####################################################################
pgrole="plex"
port_inside01="32400/tcp"; port_outside01="32400"
port_inside02="3005/tcp"; port_outside02="3005"
port_inside03="8324/tcp"; port_outside03="8324"
port_inside04="32410/udp"; port_outside04="32410"
port_inside05="32412/udp"; port_outside05="32412"
port_inside06="32413/udp"; port_outside06="32413"
port_inside07="32414/udp"; port_outside07="32414"
port_inside08="33400/tcp"; port_outside08="33400"
port_inside09="33443/tcp"; port_outside09="33443"
traefik_extport="32400"
common_fcreate_silent /pg/transcodes
common_fcreate_silent /pg/data/plex
common_main /pg/data/plex/plex.claim "" plex_claim
container_path /etc/localtime /etc/localtime:ro
container_path /pg/data/$pgrole/database /config
container_path /tmp /tmp
container_path /pg /pg
container_path /pg/transcodes /transcode
container_path /dev/shm /ram_transcode
container_path /pg/unity /unity
advertise_ip=$(hostname -I | awk '{print $1}')
container_permissions PLEX_UID 1000
container_permissions PLEX_GID 1000
container_permissions VERSION docker
container_permissions PLEX_CLAIM $plex_claim
container_permissions ADVERTISE_IP "http://$advertise_ip:32400"
if [[ -e "/pg/data/plex/image.set" ]]; then
# For PMS
if [[ $(cat "/pg/data/plex/image.set" | grep "linuxserver") == "" ]]; then
echo "plex" > "/pg/data/plex/plex.docker.user"; else
echo "abc" > "/pg/data/plex/plex.docker.user"; fi
else
echo "plex" > "/pg/data/plex/plex.docker.user"
fi
# container_oddball devices "{{ '/dev/dri:/dev/dri' if dev_dri.stat.exists == True | default(false) else omit }}"
container_oddball etc_hosts "{ 'analytics.plex.tv': '127.0.0.1', 'metrics.plex.tv': '127.0.0.1' }"
# IMAGES EXPORT - 1ST IS DEFAULT ###############################################
cat <<- EOF > "/pg/images/$pgrole.images"
linuxserver/tautulli latest
linuxserver/tautulli develop
EOF
# IMAGES EXPORT - 1ST IS DEFAULT ###############################################
cat <<- EOF > "/pg/images/$pgrole.images"
linuxserver/plex:latest
linuxserver/plex:public
plexinc/pms-docker:latest
plexinc/pms-docker:plexpass
plexinc/pms-docker:public
plexinc/pms-docker:beta
EOF
# YML EXPORT ###################################################################
container_core
cat <<- EOF > "/pg/apps/$pgrole.yml"
$container_header
### ALIGN WITH THE A ################################## START - EXTRAS #########
####### ALIGN WITH THE A ############################## CORE ###################
$container_start
published_ports:
- '${portcheck_add}${port_outside01}:${port_inside01}'
- '$portstatus$port_outside02:$port_inside02'
- '$portstatus$port_outside03:$port_inside03'
- '$portstatus$port_outside04:$port_inside04'
- '$portstatus$port_outside05:$port_inside05'
- '$portstatus$port_outside06:$port_inside06'
- '$portstatus$port_outside07:$port_inside07'
- '$portstatus$port_outside08:$port_inside08'
- '$portstatus$port_outside09:$port_inside09'
env:
$container_permissions
labels:
$container_traefik
$container_oddball
$container_ending
### ALIGN WITH THE A ################################## END - EXTRAS ###########
EOF
}