Skip to content

Commit 1ed5257

Browse files
committed
more tidying
1 parent c90bb62 commit 1ed5257

3 files changed

Lines changed: 37 additions & 25 deletions

File tree

Dockerfile

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,22 @@ RUN \
1717
dbus \
1818
wget && \
1919

20-
# cleanup
21-
apt-get clean && \
22-
rm -rf /tmp/* /var/lib/apt/lists/* /var/tmp/*
23-
2420
# install plex
25-
RUN \
2621
curl -o \
2722
/tmp/plexmediaserver.deb -L \
2823
"${PLEX_WWW}" && \
2924
dpkg -i /tmp/plexmediaserver.deb && \
30-
rm -f /tmp/*
25+
26+
# cleanup
27+
apt-get clean && \
28+
rm -rf \
29+
/tmp/* \
30+
/var/lib/apt/lists/* \
31+
/var/tmp/*
3132

3233
# add local files
3334
COPY root/ /
3435

3536
# ports and volumes
36-
VOLUME /config /transcode
3737
EXPOSE 32400 32400/udp 32469 32469/udp 5353/udp 1900/udp
38+
VOLUME /config /transcode

root/etc/cont-init.d/20-dbus

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
#!/usr/bin/with-contenv bash
22

3-
[[ -e /var/run/dbus/pid ]] && rm -f /var/run/dbus/pid
4-
3+
# make folders
54
mkdir -p /var/run/dbus
6-
chown messagebus:messagebus /var/run/dbus
5+
6+
# delete existing pid if found
7+
[[ -e /var/run/dbus/pid ]] && \
8+
rm -f /var/run/dbus/pid
9+
10+
# permissions
11+
chown messagebus:messagebus \
12+
/var/run/dbus
713
dbus-uuidgen --ensure
814
sleep 1
9-

root/etc/cont-init.d/30-plex-update

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
#!/usr/bin/with-contenv bash
22

33
# opt out for autoupdates
4-
[ "$ADVANCED_DISABLEUPDATES" ] && exit 0
4+
[ "$ADVANCED_DISABLEUPDATES" ] && \
5+
exit 0
56

67
# set header for no preferences/token message
7-
[[ -e /tmp/no-token.nfo ]] && rm /tmp/no-token.nfo
8+
[[ -e /tmp/no-token.nfo ]] && \
9+
rm /tmp/no-token.nfo
810
NOTOKEN_SET='/tmp/no-token.nfo'
911
cat > "${NOTOKEN_SET}" <<-EOFTOKEN
1012

@@ -28,8 +30,8 @@ fi
2830

2931
# attempt to read plex token
3032
PLEX_TOKEN=$( sed -n 's/.*PlexOnlineToken="//p' \
31-
"/config/Library/Application Support/Plex Media Server/Preferences.xml" \
32-
| sed "s/\".*//")
33+
"/config/Library/Application Support/Plex Media Server/Preferences.xml" \
34+
| sed "s/\".*//")
3335

3436
# if plex token isn't found, exit out
3537
if [ -z "$PLEX_TOKEN" ]; then
@@ -39,7 +41,7 @@ cat >> "${NOTOKEN_SET}" <<-EOFTOKEN
3941

4042

4143
EOFTOKEN
42-
less /tmp/no-token.nfo
44+
echo "$(cat /tmp/no-token.nfo)"
4345
exit 0
4446
fi
4547

@@ -49,7 +51,8 @@ INSTALLED=$(dpkg-query -W -f='${Version}' plexmediaserver)
4951

5052
# start update routine
5153

52-
[ "$PLEXPASS" ] && echo "PLEXPASS is deprecated, please use VERSION"
54+
[ "$PLEXPASS" ] && \
55+
echo "PLEXPASS is deprecated, please use VERSION"
5356

5457
if [[ -z $VERSION && "$PLEXPASS" == "1" || $VERSION = "plexpass" ]]; then echo "VERSION=plexpass is depricated please use version latest"; fi
5558

@@ -67,18 +70,21 @@ fi
6770

6871
last=130
6972
if [[ "$VERSION" == "" ]]; then
70-
echo "VERSION variable not set, current installed version $INSTALLED"
73+
echo "VERSION variable not set, current installed version $INSTALLED"
7174
elif [[ "$VERSION" != "$INSTALLED" ]]; then
72-
echo "Upgrading from version: $INSTALLED to version: $VERSION"
73-
while [[ $last -ne "0" ]]; do
75+
echo "Upgrading from version: $INSTALLED to version: $VERSION"
76+
while [[ $last -ne "0" ]]; do
7477
rm -f /tmp/plexmediaserver_*.deb
7578
curl -o /tmp/plexmediaserver_"${VERSION}"_amd64.deb -L \
76-
"${PLEX_URL}/plex-media-server/$VERSION/plexmediaserver_${VERSION}_amd64.deb"
77-
last=$?
79+
"${PLEX_URL}/plex-media-server/$VERSION/plexmediaserver_${VERSION}_amd64.deb"
80+
last=$?
7881
done
79-
[[ ! -e /tmp/plexmediaserver_"${VERSION}"_amd64.deb ]] && exit 0
80-
apt-get remove --purge -y plexmediaserver
81-
dpkg -i /tmp/plexmediaserver_"${VERSION}"_amd64.deb
82+
[[ ! -e /tmp/plexmediaserver_"${VERSION}"_amd64.deb ]] && \
83+
exit 0
84+
apt-get remove --purge -y \
85+
plexmediaserver
86+
dpkg -i /tmp/plexmediaserver_"${VERSION}"_amd64.deb
87+
8288
else
8389
echo "No need to update!"
8490
fi

0 commit comments

Comments
 (0)