Merge pull request #85 from linuxserver/case_insensitive_version_check

use ",," instead of export and case switch
pull/87/merge 45
Neil 8 years ago committed by GitHub
commit 88c81df5ae

@ -100,6 +100,7 @@ Valid settings for VERSION are:-
## Versions ## 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 + **17.10.16:** Allow use of uppercase version variable
+ **01.10.16:** Add TZ info to README. + **01.10.16:** Add TZ info to README.
+ **09.09.16:** Add layer badges to README. + **09.09.16:** Add layer badges to README.

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

Loading…
Cancel
Save