Merge pull request #85 from linuxserver/case_insensitive_version_check

use ",," instead of export and case switch
This commit is contained in:
Neil 2017-01-03 02:23:18 +00:00 committed by GitHub
commit 88c81df5ae
2 changed files with 3 additions and 4 deletions

View File

@ -100,6 +100,7 @@ Valid settings for VERSION are:-
## Versions
+ **03.01.17:** Use case insensitive version variable matching rather than export and make lowercase.
+ **17.10.16:** Allow use of uppercase version variable
+ **01.10.16:** Add TZ info to README.
+ **09.09.16:** Add layer badges to README.

View File

@ -1,6 +1,4 @@
#!/usr/bin/with-contenv bash
# Check variable status
export VERSION=$(echo "$VERSION" | tr '[:upper:]' '[:lower:]')
# copy config on first run, regardless of update status
[[ ! -e /etc/default/plexmediaserver ]] && \
@ -90,9 +88,9 @@ fi
INSTALLED_VERSION=$(dpkg-query -W -f='${Version}' plexmediaserver)
# start update routine
if [[ "$VERSION" = latest ]] || [[ "$VERSION" = plexpass ]] || [[ "$PLEXPASS" == "1" ]]; then
if [[ "${VERSION,,}" = latest ]] || [[ "${VERSION,,}" = plexpass ]] || [[ "$PLEXPASS" == "1" ]]; then
REMOTE_VERSION=$(curl -s "${PLEX_INSTALL}&X-Plex-Token=$PLEX_TOKEN"| cut -d "/" -f 5 )
elif [[ "$VERSION" = public ]]; then
elif [[ "${VERSION,,}" = public ]]; then
PLEX_TOKEN=""
REMOTE_VERSION=$(curl -s "${PLEX_INSTALL}&X-Plex-Token=$PLEX_TOKEN"| cut -d "/" -f 5 )
else