mirror of
https://github.com/mrworf/plexupdate.git
synced 2025-08-21 05:43:20 -07:00
Merge pull request #49 from joemiller/print-url-opt
add option -r to print the download url and exit
This commit is contained in:
commit
3a6ec96422
2 changed files with 10 additions and 2 deletions
|
@ -40,6 +40,8 @@ There are a few other options for the more enterprising user. Setting any of the
|
||||||
The default behavior of plexupdate.sh is to download the PlexPass edition of Plex Media Center. Setting this option to `yes` will make it download the public version instead. If this is yes, then `EMAIL` and `PASS` is no longer needed.
|
The default behavior of plexupdate.sh is to download the PlexPass edition of Plex Media Center. Setting this option to `yes` will make it download the public version instead. If this is yes, then `EMAIL` and `PASS` is no longer needed.
|
||||||
- FORCE
|
- FORCE
|
||||||
Normally plexupdate.sh will avoid downloading a file it already has or if it's the same as the installed version, but this allows you to override.
|
Normally plexupdate.sh will avoid downloading a file it already has or if it's the same as the installed version, but this allows you to override.
|
||||||
|
- PRINT_URL
|
||||||
|
Authenticate, fetch the download URL, print it, and then exit.
|
||||||
|
|
||||||
Most of these options can be specified on the command-line as well, this is just a more convenient way of doing it if you're scripting it. Which brings us to...
|
Most of these options can be specified on the command-line as well, this is just a more convenient way of doing it if you're scripting it. Which brings us to...
|
||||||
|
|
||||||
|
|
|
@ -87,11 +87,11 @@ URL_DOWNLOAD_PUBLIC=https://plex.tv/downloads
|
||||||
|
|
||||||
# Parse commandline
|
# Parse commandline
|
||||||
ALLARGS="$@"
|
ALLARGS="$@"
|
||||||
set -- $(getopt aufhko: -- "$@")
|
set -- $(getopt aufhkro: -- "$@")
|
||||||
while true;
|
while true;
|
||||||
do
|
do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
(-h) echo -e "Usage: $(basename $0) [-afhkopsuU]\n\na = Auto install if download was successful (requires root)\nd = Auto delete after auto install\nf = Force download even if it's the same version or file already exists (WILL NOT OVERWRITE)\nh = This help\nk = Reuse last authentication\no = 32-bit version (default 64 bit)\np = Public Plex Media Server version\nu = Auto update plexupdate.sh before running it (experimental)\nU = Do not autoupdate plexupdate.sh (experimental, default)\ns = Auto start (needed for some distros)\n"; exit 0;;
|
(-h) echo -e "Usage: $(basename $0) [-afhkopsuU]\n\na = Auto install if download was successful (requires root)\nd = Auto delete after auto install\nf = Force download even if it's the same version or file already exists (WILL NOT OVERWRITE)\nh = This help\nk = Reuse last authentication\no = 32-bit version (default 64 bit)\np = Public Plex Media Server version\nu = Auto update plexupdate.sh before running it (experimental)\nU = Do not autoupdate plexupdate.sh (experimental, default)\ns = Auto start (needed for some distros)\np = Print download URL and exit\n"; exit 0;;
|
||||||
(-a) AUTOINSTALL=yes;;
|
(-a) AUTOINSTALL=yes;;
|
||||||
(-d) AUTODELETE=yes;;
|
(-d) AUTODELETE=yes;;
|
||||||
(-f) FORCE=yes;;
|
(-f) FORCE=yes;;
|
||||||
|
@ -101,6 +101,7 @@ do
|
||||||
(-u) AUTOUPDATE=yes;;
|
(-u) AUTOUPDATE=yes;;
|
||||||
(-U) AUTOUPDATE=no;;
|
(-U) AUTOUPDATE=no;;
|
||||||
(-s) AUTOSTART=yes;;
|
(-s) AUTOSTART=yes;;
|
||||||
|
(-r) PRINT_URL=yes;;
|
||||||
(--) ;;
|
(--) ;;
|
||||||
(-*) echo "Error: unrecognized option $1" 1>&2; exit 1;;
|
(-*) echo "Error: unrecognized option $1" 1>&2; exit 1;;
|
||||||
(*) break;;
|
(*) break;;
|
||||||
|
@ -280,6 +281,11 @@ if [ $? -ne 0 ]; then
|
||||||
exit 3
|
exit 3
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ "${PRINT_URL}" == "yes" ]; then
|
||||||
|
echo "${DOWNLOAD}"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
# By default, try downloading
|
# By default, try downloading
|
||||||
SKIP_DOWNLOAD="no"
|
SKIP_DOWNLOAD="no"
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue