forked from adamgot/python-plexlibrary
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathInstall.sh
55 lines (43 loc) · 2.13 KB
/
Install.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/bash
######################################################
# Title: SudoBox #
# started from Adamgot #
# URL: https://sudobox.io #
######################################################
#variable recalls
cat "/opt/appdata/plex/database/Library/Application Support/Plex Media Server/Preferences.xml" | sed -e 's;^.* PlexOnlineToken=";;' | sed -e 's;".*$;;' | tail -1 >> /opt/sudobox/var/plex.token
plexlibrary=(/opt/sudobox/python-plexlibrary)
plex.token=(cat opt/sudobox/var/plex.token)
#Checks Plex has been installed and is running
plexcheck() {
pcheck=$(docker ps --format '{{.Names}}' | grep "plex")
if [ "$pcheck" == "" ]; then
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⛔️ WARNING! - Plex is not Installed/Running! Cannot Proceed!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
read -p 'Confirm Info | PRESS [ENTER] ' typed </dev/tty
question1
fi
}
#check Trakt api client file exist if it does then copy to
if [[ -f /var/plexguide/traktarr/trakt.client ]]
then
traktid$(cat /var/plexguide/traktarr/trakt.client)
echo "<file> exists on your filesystem"
fi
#check Trakt api secret file exist if it does then copy to
if [[ -f /var/plexguide/traktarr/trakt.secret ]]
then
traktid$(cat /var/plexguide/traktarr/trakt.secret)
echo "<file> exists on your filesystem"
fi
#### create folders & set permissions
USER=$(getent passwd 1000 | awk -F: '{ print $1}')
mkdir -p /opt/sudobox/var
mkdir -p /opt/sudobox/python-plexlibrary
#Download and put required files into the correct directory
git clone -b plex-movie-agent --single-branch https://github.com/Xpl0yt91/python-plexlibrary.git $plexlibrary
#install requirements
pip install -rv $plexlibrary/requirements.txt