more tidying

pull/52/head
sparklyballs 8 years ago
parent c90bb62612
commit 1ed5257235

@ -17,21 +17,22 @@ RUN \
dbus \ dbus \
wget && \ wget && \
# cleanup
apt-get clean && \
rm -rf /tmp/* /var/lib/apt/lists/* /var/tmp/*
# install plex # install plex
RUN \
curl -o \ curl -o \
/tmp/plexmediaserver.deb -L \ /tmp/plexmediaserver.deb -L \
"${PLEX_WWW}" && \ "${PLEX_WWW}" && \
dpkg -i /tmp/plexmediaserver.deb && \ dpkg -i /tmp/plexmediaserver.deb && \
rm -f /tmp/*
# cleanup
apt-get clean && \
rm -rf \
/tmp/* \
/var/lib/apt/lists/* \
/var/tmp/*
# add local files # add local files
COPY root/ / COPY root/ /
# ports and volumes # ports and volumes
VOLUME /config /transcode
EXPOSE 32400 32400/udp 32469 32469/udp 5353/udp 1900/udp EXPOSE 32400 32400/udp 32469 32469/udp 5353/udp 1900/udp
VOLUME /config /transcode

@ -1,9 +1,14 @@
#!/usr/bin/with-contenv bash #!/usr/bin/with-contenv bash
[[ -e /var/run/dbus/pid ]] && rm -f /var/run/dbus/pid # make folders
mkdir -p /var/run/dbus mkdir -p /var/run/dbus
chown messagebus:messagebus /var/run/dbus
# delete existing pid if found
[[ -e /var/run/dbus/pid ]] && \
rm -f /var/run/dbus/pid
# permissions
chown messagebus:messagebus \
/var/run/dbus
dbus-uuidgen --ensure dbus-uuidgen --ensure
sleep 1 sleep 1

@ -1,10 +1,12 @@
#!/usr/bin/with-contenv bash #!/usr/bin/with-contenv bash
# opt out for autoupdates # opt out for autoupdates
[ "$ADVANCED_DISABLEUPDATES" ] && exit 0 [ "$ADVANCED_DISABLEUPDATES" ] && \
exit 0
# set header for no preferences/token message # set header for no preferences/token message
[[ -e /tmp/no-token.nfo ]] && rm /tmp/no-token.nfo [[ -e /tmp/no-token.nfo ]] && \
rm /tmp/no-token.nfo
NOTOKEN_SET='/tmp/no-token.nfo' NOTOKEN_SET='/tmp/no-token.nfo'
cat > "${NOTOKEN_SET}" <<-EOFTOKEN cat > "${NOTOKEN_SET}" <<-EOFTOKEN
@ -28,8 +30,8 @@ fi
# attempt to read plex token # attempt to read plex token
PLEX_TOKEN=$( sed -n 's/.*PlexOnlineToken="//p' \ PLEX_TOKEN=$( sed -n 's/.*PlexOnlineToken="//p' \
"/config/Library/Application Support/Plex Media Server/Preferences.xml" \ "/config/Library/Application Support/Plex Media Server/Preferences.xml" \
| sed "s/\".*//") | sed "s/\".*//")
# if plex token isn't found, exit out # if plex token isn't found, exit out
if [ -z "$PLEX_TOKEN" ]; then if [ -z "$PLEX_TOKEN" ]; then
@ -39,7 +41,7 @@ cat >> "${NOTOKEN_SET}" <<-EOFTOKEN
EOFTOKEN EOFTOKEN
less /tmp/no-token.nfo echo "$(cat /tmp/no-token.nfo)"
exit 0 exit 0
fi fi
@ -49,7 +51,8 @@ INSTALLED=$(dpkg-query -W -f='${Version}' plexmediaserver)
# start update routine # start update routine
[ "$PLEXPASS" ] && echo "PLEXPASS is deprecated, please use VERSION" [ "$PLEXPASS" ] && \
echo "PLEXPASS is deprecated, please use VERSION"
if [[ -z $VERSION && "$PLEXPASS" == "1" || $VERSION = "plexpass" ]]; then echo "VERSION=plexpass is depricated please use version latest"; fi if [[ -z $VERSION && "$PLEXPASS" == "1" || $VERSION = "plexpass" ]]; then echo "VERSION=plexpass is depricated please use version latest"; fi
@ -67,18 +70,21 @@ fi
last=130 last=130
if [[ "$VERSION" == "" ]]; then if [[ "$VERSION" == "" ]]; then
echo "VERSION variable not set, current installed version $INSTALLED" echo "VERSION variable not set, current installed version $INSTALLED"
elif [[ "$VERSION" != "$INSTALLED" ]]; then elif [[ "$VERSION" != "$INSTALLED" ]]; then
echo "Upgrading from version: $INSTALLED to version: $VERSION" echo "Upgrading from version: $INSTALLED to version: $VERSION"
while [[ $last -ne "0" ]]; do while [[ $last -ne "0" ]]; do
rm -f /tmp/plexmediaserver_*.deb rm -f /tmp/plexmediaserver_*.deb
curl -o /tmp/plexmediaserver_"${VERSION}"_amd64.deb -L \ curl -o /tmp/plexmediaserver_"${VERSION}"_amd64.deb -L \
"${PLEX_URL}/plex-media-server/$VERSION/plexmediaserver_${VERSION}_amd64.deb" "${PLEX_URL}/plex-media-server/$VERSION/plexmediaserver_${VERSION}_amd64.deb"
last=$? last=$?
done done
[[ ! -e /tmp/plexmediaserver_"${VERSION}"_amd64.deb ]] && exit 0 [[ ! -e /tmp/plexmediaserver_"${VERSION}"_amd64.deb ]] && \
apt-get remove --purge -y plexmediaserver exit 0
dpkg -i /tmp/plexmediaserver_"${VERSION}"_amd64.deb apt-get remove --purge -y \
plexmediaserver
dpkg -i /tmp/plexmediaserver_"${VERSION}"_amd64.deb
else else
echo "No need to update!" echo "No need to update!"
fi fi

Loading…
Cancel
Save