mirror of
https://github.com/mrworf/plexupdate.git
synced 2025-08-19 12:59:40 -07:00
Make plexupdate-core available earlier in installer.sh
This commit is contained in:
parent
293e6d5ecb
commit
0065210791
2 changed files with 20 additions and 9 deletions
|
@ -16,6 +16,19 @@ PUBLIC=
|
||||||
CONFIGVARS="AUTOINSTALL AUTODELETE DOWNLOADDIR TOKEN FORCE FORCEALL PUBLIC AUTOSTART AUTOUPDATE PLEXSERVER PLEXPORT CHECKUPDATE NOTIFY"
|
CONFIGVARS="AUTOINSTALL AUTODELETE DOWNLOADDIR TOKEN FORCE FORCEALL PUBLIC AUTOSTART AUTOUPDATE PLEXSERVER PLEXPORT CHECKUPDATE NOTIFY"
|
||||||
CRONVARS="CONF SCRIPT LOGGING"
|
CRONVARS="CONF SCRIPT LOGGING"
|
||||||
|
|
||||||
|
if [ "$0" = "installer.sh" ]; then
|
||||||
|
source "$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/plexupdate-core"
|
||||||
|
else
|
||||||
|
if hash wget 2>/dev/null; then
|
||||||
|
DOWNLOADER="wget -qO -"
|
||||||
|
elif hash curl 2>/dev/null; then
|
||||||
|
DOWNLOADER="curl -fsSL"
|
||||||
|
fi
|
||||||
|
# there is no 'else' because if this is being run plexupdate is either already installed
|
||||||
|
# or they already have either wget or curl
|
||||||
|
source <($DOWNLOADER "${ORIGIN_REPO}/${BRANCHNAME:-master}/plexupdate-core")
|
||||||
|
fi
|
||||||
|
|
||||||
install() {
|
install() {
|
||||||
echo "'$req' is required but not installed, attempting to install..."
|
echo "'$req' is required but not installed, attempting to install..."
|
||||||
sleep 1
|
sleep 1
|
||||||
|
@ -95,11 +108,6 @@ noyes() {
|
||||||
yesno N
|
yesno N
|
||||||
}
|
}
|
||||||
|
|
||||||
abort() {
|
|
||||||
echo "$@"
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
install_plexupdate() {
|
install_plexupdate() {
|
||||||
echo
|
echo
|
||||||
read -e -p "Directory to install into: " -i "/opt/plexupdate" FULL_PATH
|
read -e -p "Directory to install into: " -i "/opt/plexupdate" FULL_PATH
|
||||||
|
@ -343,8 +351,6 @@ else
|
||||||
install_plexupdate
|
install_plexupdate
|
||||||
fi
|
fi
|
||||||
|
|
||||||
source "${FULL_PATH}/plexupdate-core"
|
|
||||||
|
|
||||||
configure_plexupdate
|
configure_plexupdate
|
||||||
configure_cron
|
configure_cron
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
# GPW -> getPlexWebToken
|
# GPW -> getPlexWebToken
|
||||||
# HELPERS -> keypair, rawurlencode, trimQuotes
|
# HELPERS -> keypair, rawurlencode, trimQuotes
|
||||||
# RNNG -> running
|
# RNNG -> running
|
||||||
# SHARED -> warn, info, warn
|
# SHARED -> warn, info, error, abort
|
||||||
|
|
||||||
######## CONSTANTS ########
|
######## CONSTANTS ########
|
||||||
# Current pages we need - Do not change unless Plex.tv changes again
|
# Current pages we need - Do not change unless Plex.tv changes again
|
||||||
|
@ -272,8 +272,13 @@ error() {
|
||||||
echo "ERROR: $@" >&2
|
echo "ERROR: $@" >&2
|
||||||
}
|
}
|
||||||
|
|
||||||
|
abort() {
|
||||||
|
echo "$@" >&2
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
# Intentionally leaving this hard to find so that people aren't trying to use it manually.
|
# Intentionally leaving this hard to find so that people aren't trying to use it manually.
|
||||||
if [ "$(basename "$0")" = "get-plex-token" ]; then
|
if [ "$(basename "$0")" = "get-plex-token" ]; then
|
||||||
[ -f /etc/plexupdate.conf ] && source /etc/plexupdate.conf
|
[ -f /etc/plexupdate.conf ] && source /etc/plexupdate.conf
|
||||||
getPlexToken && info "Token = $TOKEN"
|
getPlexToken && info "TOKEN=$TOKEN"
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue