|
1 | 1 | #!/usr/bin/with-contenv bash |
2 | 2 |
|
3 | 3 | # set no update message |
| 4 | +[[ -e /tmp/no-version.nfo ]] && \ |
| 5 | + rm /tmp/no-version.nfo |
| 6 | +NOVERSION_SET='/tmp/no-version.nfo' |
| 7 | +cat > "${NOVERSION_SET}" <<-EOFVERSION |
| 8 | + |
| 9 | + |
4 | 10 | ####################################################### |
5 | | -# Update routine will not run, this is either because # |
6 | | -# you havent set the VERSION variable or have set # |
7 | | -# $ADVANCED_DISABLEUPDATES, for more information, see # |
8 | | -# <link not placed yet> # |
| 11 | +# Update routine will not run because you havent set # |
| 12 | +# the VERSION variable, for more information checkout # |
| 13 | +# https://github.com/linuxserver/docker-plex # |
9 | 14 | ####################################################### |
| 15 | +EOFVERSION |
10 | 16 |
|
11 | 17 | # test for no version set or opt out for autoupdates |
12 | | -[[ "$ADVANCED_DISABLEUPDATES" ]] && \ |
13 | | - exit 0 |
| 18 | +if [[ -z "$VERSION" ]] || [[ "$VERSION"=="0" ]] || [ "$ADVANCED_DISABLEUPDATES" ]; then |
| 19 | +echo "$(cat /tmp/no-version.nfo)" |
| 20 | +exit 0 |
| 21 | +fi |
14 | 22 |
|
15 | 23 | # set header for no preferences/token message |
16 | 24 | [[ -e /tmp/no-token.nfo ]] && \ |
@@ -59,27 +67,23 @@ INSTALLED=$(dpkg-query -W -f='${Version}' plexmediaserver) |
59 | 67 |
|
60 | 68 | # start update routine |
61 | 69 |
|
62 | | -[ "$PLEXPASS" ] && \ |
| 70 | +[[ "$PLEXPASS" ]] && \ |
63 | 71 | echo "PLEXPASS is deprecated, please use VERSION" |
64 | 72 |
|
65 | | -if [[ -z $VERSION && "$PLEXPASS" == "1" || $VERSION = "plexpass" ]]; then echo "VERSION=plexpass is depricated please use version latest"; fi |
| 73 | +if [[ -z $VERSION && "$PLEXPASS" == "1" || $VERSION = "plexpass" ]]; then echo "VERSION=plexpass is deprecated please use version latest"; fi |
66 | 74 |
|
67 | 75 | if [[ "$VERSION" = latest || "$VERSION" = plexpass ]]; then |
68 | 76 | VERSION=$(curl -s "${PLEX_URL}/latest/1?channel=8&build=linux-ubuntu-x86_64&distro=ubuntu&X-Plex-Token=$PLEX_TOKEN"| cut -d "/" -f 5 ) |
69 | | - echo "Target version: $VERSION set by: latest\plexpass" |
| 77 | + echo "Target version: $VERSION set to: latest\plexpass" |
70 | 78 | elif [[ "$VERSION" = public ]]; then |
71 | 79 | VERSION=$(curl -s "${PLEX_URL}/latest/1?channel=8&build=linux-ubuntu-x86_64&distro=ubuntu&X-Plex-Token="| cut -d "/" -f 5 ) |
72 | | - echo "Target version: $VERSION set by: public" |
73 | | -elif [[ -z "$VERSION" ]]; then |
74 | | - echo "Target version: Version not set, Defaulting to supplied version" |
| 80 | + echo "Target version: $VERSION set to: public" |
75 | 81 | else |
76 | | - echo "Target version: $VERSION set by: manually" |
| 82 | + echo "Target version: $VERSION set to: manual" |
77 | 83 | fi |
78 | 84 |
|
79 | 85 | last=130 |
80 | | -if [[ "$VERSION" == "" ]]; then |
81 | | - echo "VERSION variable not set, current installed version $INSTALLED" |
82 | | -elif [[ "$VERSION" != "$INSTALLED" ]]; then |
| 86 | +if [[ "$VERSION" != "$INSTALLED" ]]; then |
83 | 87 | echo "Upgrading from version: $INSTALLED to version: $VERSION" |
84 | 88 | while [[ $last -ne "0" ]]; do |
85 | 89 | rm -f /tmp/plexmediaserver_*.deb |
|
98 | 102 | fi |
99 | 103 |
|
100 | 104 | cp -v /defaults/plexmediaserver /etc/default/plexmediaserver |
101 | | - |
|
0 commit comments