mirror of
https://github.com/mrworf/plexupdate.git
synced 2025-07-16 02:02:58 -07:00
Merge remote-tracking branch 'origin/master' into dsm7
This commit is contained in:
commit
ade4ddfeae
3 changed files with 15 additions and 6 deletions
|
@ -246,11 +246,16 @@ configure_cron() {
|
||||||
return 1
|
return 1
|
||||||
fi
|
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
|
||||||
echo -n "Would you like to set up automatic daily updates for Plex? "
|
echo -n "Would you like to set up automatic daily updates for Plex? "
|
||||||
if yesno $CRON; then
|
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
|
if [ $(sudo find -L "${FULL_PATH}" -perm /002 -or -not -uid 0 -or -not -gid 0 | wc -l) -ne 0 ]; then
|
||||||
echo
|
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."
|
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
|
||||||
if wget --show-progress -V &> /dev/null; then
|
if wget --show-progress -V &> /dev/null; then
|
||||||
PROGRESS_OPT="-P"
|
PROGRESS_OPT="-P"
|
||||||
fi
|
fi
|
||||||
if [ "$AUTOINSTALL" == "yes" ]; then
|
if [ "$AUTOINSTALL" == "yes" -o "$CRON" == "yes" ]; then
|
||||||
sudo -E "$FULL_PATH/plexupdate.sh" $PROGRESS_OPT --config "$CONFIGFILE"
|
sudo -E "$FULL_PATH/plexupdate.sh" $PROGRESS_OPT --config "$CONFIGFILE"
|
||||||
else
|
else
|
||||||
"$FULL_PATH/plexupdate.sh" $PROGRESS_OPT --config "$CONFIGFILE"
|
"$FULL_PATH/plexupdate.sh" $PROGRESS_OPT --config "$CONFIGFILE"
|
||||||
|
|
|
@ -78,9 +78,9 @@ getPlexServerToken() {
|
||||||
if [ ! -z "${I}" -a -f "${I}${PREFFILE}" ]; then
|
if [ ! -z "${I}" -a -f "${I}${PREFFILE}" ]; then
|
||||||
# When running installer.sh directly from wget, $0 will return bash
|
# When running installer.sh directly from wget, $0 will return bash
|
||||||
if [ "$(basename $0)" = "installer.sh" -o "$(basename $0)" = "bash" ]; then
|
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
|
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
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
|
@ -53,6 +53,8 @@ AUTODELETE=no
|
||||||
AUTOUPDATE=no
|
AUTOUPDATE=no
|
||||||
AUTOSTART=no
|
AUTOSTART=no
|
||||||
ARCH=$(uname -m)
|
ARCH=$(uname -m)
|
||||||
|
# patch for Raspberry Pi reporting as armv7l, whereas Plex only offers armv7neon
|
||||||
|
[ "$ARCH" = "armv7l" ] && ARCH="armv7neon"
|
||||||
BUILD="linux-$ARCH"
|
BUILD="linux-$ARCH"
|
||||||
SHOWPROGRESS=no
|
SHOWPROGRESS=no
|
||||||
WGETOPTIONS="" # extra options for wget. Used for progress bar.
|
WGETOPTIONS="" # extra options for wget. Used for progress bar.
|
||||||
|
@ -231,13 +233,15 @@ if [ "${AUTOUPDATE}" = "yes" ]; then
|
||||||
else
|
else
|
||||||
if [ -z "${BRANCHNAME}" ]; then
|
if [ -z "${BRANCHNAME}" ]; then
|
||||||
BRANCHNAME="$(git symbolic-ref -q --short HEAD)"
|
BRANCHNAME="$(git symbolic-ref -q --short HEAD)"
|
||||||
elif [ "${BRANCHNAME}" != "$(git symbolic-ref -q --short HEAD)" ]; then
|
|
||||||
git checkout "${BRANCHNAME}"
|
|
||||||
fi
|
fi
|
||||||
# Force FETCH_HEAD to point to the correct branch (for older versions of git which don't default to current branch)
|
# 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
|
if git fetch origin ${BRANCHNAME} --quiet && ! git diff --quiet FETCH_HEAD; then
|
||||||
info "Auto-updating..."
|
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
|
# 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
|
# just run in "dumb" mode without trying to restore permissions
|
||||||
declare -A FILE_OWNER FILE_PERMS && \
|
declare -A FILE_OWNER FILE_PERMS && \
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue