From 9e25638a2f200403e891e79314eaa2132c5141d5 Mon Sep 17 00:00:00 2001 From: Elliott Partridge Date: Tue, 4 Feb 2020 14:30:12 -0500 Subject: [PATCH 1/7] Expanded plex token characters to include '-' and '_' (#271) Solves issue updating private builds --- plexupdate-core | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plexupdate-core b/plexupdate-core index d0ec57e..4d81751 100755 --- a/plexupdate-core +++ b/plexupdate-core @@ -78,9 +78,9 @@ getPlexServerToken() { if [ ! -z "${I}" -a -f "${I}${PREFFILE}" ]; then # When running installer.sh directly from wget, $0 will return bash if [ "$(basename $0)" = "installer.sh" -o "$(basename $0)" = "bash" ]; then - TOKEN=$(sudo sed -n 's/.*PlexOnlineToken="\([[:alnum:]]*\).*".*/\1/p' "${I}${PREFFILE}" 2>/dev/null) + TOKEN=$(sudo sed -n 's/.*PlexOnlineToken="\([[:alnum:]_-]*\).*".*/\1/p' "${I}${PREFFILE}" 2>/dev/null) else - TOKEN=$(sed -n 's/.*PlexOnlineToken="\([[:alnum:]]*\).*".*/\1/p' "${I}${PREFFILE}" 2>/dev/null) + TOKEN=$(sed -n 's/.*PlexOnlineToken="\([[:alnum:]_-]*\).*".*/\1/p' "${I}${PREFFILE}" 2>/dev/null) fi fi done From fdbc94faf437f5fa84f2af7fe4f1cf373753c85c Mon Sep 17 00:00:00 2001 From: lisanet Date: Tue, 4 Feb 2020 20:31:13 +0100 Subject: [PATCH 2/7] patch for Raspberry Pi 4 reporting as armv7l, whereas Plex only offers armv7hf_neon (#268) --- plexupdate.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plexupdate.sh b/plexupdate.sh index 80002be..266b945 100755 --- a/plexupdate.sh +++ b/plexupdate.sh @@ -53,6 +53,8 @@ AUTODELETE=no AUTOUPDATE=no AUTOSTART=no ARCH=$(uname -m) +# patch for Raspberry Pi 4 reporting as armv7l, whereas Plex only offers armv7hf_neon +cat /proc/cpuinfo | grep -q "Raspberry Pi 4" && ARCH=armv7hf_neon BUILD="linux-$ARCH" SHOWPROGRESS=no WGETOPTIONS="" # extra options for wget. Used for progress bar. From 887602ac85e7cb9e96e45f35293374f8dd3db803 Mon Sep 17 00:00:00 2001 From: Alex Malinovich Date: Mon, 20 Apr 2020 15:33:55 -0400 Subject: [PATCH 3/7] Generalize Raspberry Pi support to all "armv7l" architectures --- plexupdate.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plexupdate.sh b/plexupdate.sh index 266b945..0999a7a 100755 --- a/plexupdate.sh +++ b/plexupdate.sh @@ -53,8 +53,8 @@ AUTODELETE=no AUTOUPDATE=no AUTOSTART=no ARCH=$(uname -m) -# patch for Raspberry Pi 4 reporting as armv7l, whereas Plex only offers armv7hf_neon -cat /proc/cpuinfo | grep -q "Raspberry Pi 4" && ARCH=armv7hf_neon +# patch for Raspberry Pi reporting as armv7l, whereas Plex only offers armv7hf_neon +[ "$ARCH" = "armv7l" ] && ARCH="armv7hf_neon" BUILD="linux-$ARCH" SHOWPROGRESS=no WGETOPTIONS="" # extra options for wget. Used for progress bar. From 72312230707538a227d4e196fdf57afc12b4ad81 Mon Sep 17 00:00:00 2001 From: Alex Malinovich Date: Wed, 22 Apr 2020 15:14:42 -0400 Subject: [PATCH 4/7] Fix branchname switching errors --- plexupdate.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plexupdate.sh b/plexupdate.sh index 0999a7a..679ab9c 100755 --- a/plexupdate.sh +++ b/plexupdate.sh @@ -233,13 +233,15 @@ if [ "${AUTOUPDATE}" = "yes" ]; then else if [ -z "${BRANCHNAME}" ]; then BRANCHNAME="$(git symbolic-ref -q --short HEAD)" - elif [ "${BRANCHNAME}" != "$(git symbolic-ref -q --short HEAD)" ]; then - git checkout "${BRANCHNAME}" fi # Force FETCH_HEAD to point to the correct branch (for older versions of git which don't default to current branch) if git fetch origin ${BRANCHNAME} --quiet && ! git diff --quiet FETCH_HEAD; then info "Auto-updating..." + if [ "${BRANCHNAME}" != "$(git symbolic-ref -q --short HEAD)" ]; then + git checkout "${BRANCHNAME}" + fi + # Use an associative array to store permissions. If you're running bash < 4, the declare will fail and we'll # just run in "dumb" mode without trying to restore permissions declare -A FILE_OWNER FILE_PERMS && \ From 4d13feb6b18d1ea316684c52da1e419e18ac8422 Mon Sep 17 00:00:00 2001 From: Alex Malinovich Date: Tue, 21 Jul 2020 14:17:30 -0400 Subject: [PATCH 5/7] Test run should run with sudo if installed as root (#278) * Test run should run with sudo if installed as root. Fixes #277 * Make cron logic in installer more readable * Style fix for conditional * Be sure CRON option is actually set --- extras/installer.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/extras/installer.sh b/extras/installer.sh index 5f0967a..c83f878 100755 --- a/extras/installer.sh +++ b/extras/installer.sh @@ -236,11 +236,16 @@ configure_cron() { return 1 fi - [ -f "$CONFIGCRON" ] && source "$CONFIGCRON" + if [ -f "$CONFIGCRON" ]; then + #this is redundant since null is evaluated as yes anyway, but including for readability + CRON=yes + source "$CONFIGCRON" + fi echo echo -n "Would you like to set up automatic daily updates for Plex? " if yesno $CRON; then + CRON=yes if [ $(sudo find -L "${FULL_PATH}" -perm /002 -or -not -uid 0 -or -not -gid 0 | wc -l) -ne 0 ]; then echo 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." @@ -354,7 +359,7 @@ if yesno; then if wget --show-progress -V &> /dev/null; then PROGRESS_OPT="-P" fi - if [ "$AUTOINSTALL" == "yes" ]; then + if [ "$AUTOINSTALL" == "yes" -o "$CRON" == "yes" ]; then sudo -E "$FULL_PATH/plexupdate.sh" $PROGRESS_OPT --config "$CONFIGFILE" else "$FULL_PATH/plexupdate.sh" $PROGRESS_OPT --config "$CONFIGFILE" From b7b301852d0459a5cf36e17ddbece4ba6a33c841 Mon Sep 17 00:00:00 2001 From: Simone Karin Lehmann Date: Fri, 4 Jun 2021 22:44:19 +0200 Subject: [PATCH 6/7] naming scheme for Raspberry Pi package changed again. Now it's armv7neon instead of armv7hf_neon --- plexupdate.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plexupdate.sh b/plexupdate.sh index 679ab9c..36a6f56 100755 --- a/plexupdate.sh +++ b/plexupdate.sh @@ -54,7 +54,7 @@ AUTOUPDATE=no AUTOSTART=no ARCH=$(uname -m) # patch for Raspberry Pi reporting as armv7l, whereas Plex only offers armv7hf_neon -[ "$ARCH" = "armv7l" ] && ARCH="armv7hf_neon" +[ "$ARCH" = "armv7l" ] && ARCH="armv7neon" BUILD="linux-$ARCH" SHOWPROGRESS=no WGETOPTIONS="" # extra options for wget. Used for progress bar. From 9a3019223b669b20064d9640cbf62439e95371ee Mon Sep 17 00:00:00 2001 From: Simone Karin Lehmann Date: Wed, 9 Jun 2021 08:59:04 +0200 Subject: [PATCH 7/7] fixed comment about naming scheme on Raspberry Pi --- plexupdate.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plexupdate.sh b/plexupdate.sh index 36a6f56..1c6851f 100755 --- a/plexupdate.sh +++ b/plexupdate.sh @@ -53,7 +53,7 @@ AUTODELETE=no AUTOUPDATE=no AUTOSTART=no ARCH=$(uname -m) -# patch for Raspberry Pi reporting as armv7l, whereas Plex only offers armv7hf_neon +# patch for Raspberry Pi reporting as armv7l, whereas Plex only offers armv7neon [ "$ARCH" = "armv7l" ] && ARCH="armv7neon" BUILD="linux-$ARCH" SHOWPROGRESS=no