forked from varju/docker-plexconnect
-
Notifications
You must be signed in to change notification settings - Fork 0
/
start-plexconnect.sh
executable file
·38 lines (29 loc) · 957 Bytes
/
start-plexconnect.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
#!/bin/bash -e
cd /usr/src/app/PlexConnect
COMMIT_URL=https://github.com/iBaa/PlexConnect/commit/$(git rev-parse HEAD)
echo
echo "PlexConnect build ${COMMIT_URL}"
echo
if [ ! -f /data/trailers.cer ]; then
echo "Generating SSL certificate"
openssl req -new -nodes -newkey rsa:2048 \
-out /data/trailers.pem -keyout /data/trailers.key \
-x509 -days 7300 -subj "/C=US/CN=trailers.apple.com"
openssl x509 -in /data/trailers.pem -outform der -out /data/trailers.cer \
&& cat /data/trailers.key >> /data/trailers.pem
else
echo "Existing SSL certificates found at /data/"
fi
if [ ! -f ATVSettings.cfg ]; then
ln -s /data/ATVSettings.cfg
fi
cp /data/trailers.* assets/certificates/
echo [PlexConnect] > Settings.cfg
env | grep ^PLEXCONNECT_ | sed -E -e 's/^PLEXCONNECT_//' -e 's/(.*)=/\L\1 = /' >> Settings.cfg
echo
echo 'Using Settings.cfg:'
grep . Settings.cfg
echo
touch PlexConnect.log
./PlexConnect.py &
tail -f PlexConnect.log