Skip to content

Commit ade4ddf

Browse files
committed
Merge remote-tracking branch 'origin/master' into dsm7
2 parents 388ff66 + 9a30192 commit ade4ddf

3 files changed

Lines changed: 15 additions & 6 deletions

File tree

extras/installer.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,11 +246,16 @@ configure_cron() {
246246
return 1
247247
fi
248248

249-
[ -f "$CONFIGCRON" ] && source "$CONFIGCRON"
249+
if [ -f "$CONFIGCRON" ]; then
250+
#this is redundant since null is evaluated as yes anyway, but including for readability
251+
CRON=yes
252+
source "$CONFIGCRON"
253+
fi
250254

251255
echo
252256
echo -n "Would you like to set up automatic daily updates for Plex? "
253257
if yesno $CRON; then
258+
CRON=yes
254259
if [ $(sudo find -L "${FULL_PATH}" -perm /002 -or -not -uid 0 -or -not -gid 0 | wc -l) -ne 0 ]; then
255260
echo
256261
echo "WARNING: For security reasons, plexupdate needs to be installed as root in order to run automatically. In order to finish setting up automatic updates, we will change the ownership of '${FULL_PATH}' to root:root."
@@ -389,7 +394,7 @@ if yesno; then
389394
if wget --show-progress -V &> /dev/null; then
390395
PROGRESS_OPT="-P"
391396
fi
392-
if [ "$AUTOINSTALL" == "yes" ]; then
397+
if [ "$AUTOINSTALL" == "yes" -o "$CRON" == "yes" ]; then
393398
sudo -E "$FULL_PATH/plexupdate.sh" $PROGRESS_OPT --config "$CONFIGFILE"
394399
else
395400
"$FULL_PATH/plexupdate.sh" $PROGRESS_OPT --config "$CONFIGFILE"

plexupdate-core

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@ getPlexServerToken() {
7878
if [ ! -z "${I}" -a -f "${I}${PREFFILE}" ]; then
7979
# When running installer.sh directly from wget, $0 will return bash
8080
if [ "$(basename $0)" = "installer.sh" -o "$(basename $0)" = "bash" ]; then
81-
TOKEN=$(sudo sed -n 's/.*PlexOnlineToken="\([[:alnum:]]*\).*".*/\1/p' "${I}${PREFFILE}" 2>/dev/null)
81+
TOKEN=$(sudo sed -n 's/.*PlexOnlineToken="\([[:alnum:]_-]*\).*".*/\1/p' "${I}${PREFFILE}" 2>/dev/null)
8282
else
83-
TOKEN=$(sed -n 's/.*PlexOnlineToken="\([[:alnum:]]*\).*".*/\1/p' "${I}${PREFFILE}" 2>/dev/null)
83+
TOKEN=$(sed -n 's/.*PlexOnlineToken="\([[:alnum:]_-]*\).*".*/\1/p' "${I}${PREFFILE}" 2>/dev/null)
8484
fi
8585
fi
8686
done

plexupdate.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ AUTODELETE=no
5353
AUTOUPDATE=no
5454
AUTOSTART=no
5555
ARCH=$(uname -m)
56+
# patch for Raspberry Pi reporting as armv7l, whereas Plex only offers armv7neon
57+
[ "$ARCH" = "armv7l" ] && ARCH="armv7neon"
5658
BUILD="linux-$ARCH"
5759
SHOWPROGRESS=no
5860
WGETOPTIONS="" # extra options for wget. Used for progress bar.
@@ -231,13 +233,15 @@ if [ "${AUTOUPDATE}" = "yes" ]; then
231233
else
232234
if [ -z "${BRANCHNAME}" ]; then
233235
BRANCHNAME="$(git symbolic-ref -q --short HEAD)"
234-
elif [ "${BRANCHNAME}" != "$(git symbolic-ref -q --short HEAD)" ]; then
235-
git checkout "${BRANCHNAME}"
236236
fi
237237
# Force FETCH_HEAD to point to the correct branch (for older versions of git which don't default to current branch)
238238
if git fetch origin ${BRANCHNAME} --quiet && ! git diff --quiet FETCH_HEAD; then
239239
info "Auto-updating..."
240240

241+
if [ "${BRANCHNAME}" != "$(git symbolic-ref -q --short HEAD)" ]; then
242+
git checkout "${BRANCHNAME}"
243+
fi
244+
241245
# Use an associative array to store permissions. If you're running bash < 4, the declare will fail and we'll
242246
# just run in "dumb" mode without trying to restore permissions
243247
declare -A FILE_OWNER FILE_PERMS && \

0 commit comments

Comments
 (0)