more tidying

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

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

@ -1,9 +1,14 @@
#!/usr/bin/with-contenv bash
[[ -e /var/run/dbus/pid ]] && rm -f /var/run/dbus/pid
# make folders
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
sleep 1

@ -1,10 +1,12 @@
#!/usr/bin/with-contenv bash
# opt out for autoupdates
[ "$ADVANCED_DISABLEUPDATES" ] && exit 0
[ "$ADVANCED_DISABLEUPDATES" ] && \
exit 0
# 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'
cat > "${NOTOKEN_SET}" <<-EOFTOKEN
@ -28,8 +30,8 @@ fi
# attempt to read plex token
PLEX_TOKEN=$( sed -n 's/.*PlexOnlineToken="//p' \
"/config/Library/Application Support/Plex Media Server/Preferences.xml" \
| sed "s/\".*//")
"/config/Library/Application Support/Plex Media Server/Preferences.xml" \
| sed "s/\".*//")
# if plex token isn't found, exit out
if [ -z "$PLEX_TOKEN" ]; then
@ -39,7 +41,7 @@ cat >> "${NOTOKEN_SET}" <<-EOFTOKEN
EOFTOKEN
less /tmp/no-token.nfo
echo "$(cat /tmp/no-token.nfo)"
exit 0
fi
@ -49,7 +51,8 @@ INSTALLED=$(dpkg-query -W -f='${Version}' plexmediaserver)
# 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
@ -76,9 +79,12 @@ elif [[ "$VERSION" != "$INSTALLED" ]]; then
"${PLEX_URL}/plex-media-server/$VERSION/plexmediaserver_${VERSION}_amd64.deb"
last=$?
done
[[ ! -e /tmp/plexmediaserver_"${VERSION}"_amd64.deb ]] && exit 0
apt-get remove --purge -y plexmediaserver
[[ ! -e /tmp/plexmediaserver_"${VERSION}"_amd64.deb ]] && \
exit 0
apt-get remove --purge -y \
plexmediaserver
dpkg -i /tmp/plexmediaserver_"${VERSION}"_amd64.deb
else
echo "No need to update!"
fi

Loading…
Cancel
Save