forked from needo37/plex
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfirstrun.sh
31 lines (24 loc) · 789 Bytes
/
firstrun.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
#!/bin/bash
mkdir -p /var/run/dbus
chown messagebus:messagebus /var/run/dbus
dbus-uuidgen --ensure
dbus-daemon --system --fork
sleep 1
avahi-daemon -D
sleep 1
# Check to see what version of Plex is installed vs what is being requested. If requested version is different
# install that one
INSTALLED=`dpkg-query -W -f='${Version}' plexmediaserver`
if [ -z "$VERSION" ]; then
echo "Version not specified."
exit 0
fi
if [ "$VERSION" = "$INSTALLED" ]; then
echo "Version not changed"
else
mv /etc/default/plexmediaserver /tmp/
apt-get remove --purge -y plexmediaserver
wget -P /tmp "http://downloads.plexapp.com/plex-media-server/$VERSION/plexmediaserver_${VERSION}_amd64.deb"
gdebi -n /tmp/plexmediaserver_${VERSION}_amd64.deb
mv /tmp/plexmediaserver /etc/default/
fi