mirror of
https://github.com/mrworf/plexupdate.git
synced 2025-08-19 21:03:19 -07:00
Improved handling of auto update
No longer gets stuck in a loop
This commit is contained in:
parent
6adc7f99c9
commit
49fd3806ea
1 changed files with 6 additions and 9 deletions
|
@ -60,6 +60,7 @@ AUTOSTART=no
|
|||
CRON=no
|
||||
QUIET=no
|
||||
ARCH=$(uname -m)
|
||||
IGNOREAUTOUPDATE=no
|
||||
|
||||
# Default options for package managers, override if needed
|
||||
REDHAT_INSTALL="yum -y install"
|
||||
|
@ -207,7 +208,7 @@ do
|
|||
(-s) AUTOSTART=yes;;
|
||||
(-S) echo "ERROR: SILENT option has been removed, please use QUIET (-q) instead" >&2; cronexit 255;;
|
||||
(-u) AUTOUPDATE=yes;;
|
||||
(-U) AUTOUPDATE=no;;
|
||||
(-U) IGNOREAUTOUPDATE=yes;;
|
||||
(--) ;;
|
||||
(-*) echo "ERROR: unrecognized option $1" >&2; usage; cronexit 1;;
|
||||
(*) break;;
|
||||
|
@ -215,6 +216,10 @@ do
|
|||
shift
|
||||
done
|
||||
|
||||
if [ "${IGNOREAUTOUPDATE}" = "yes" ]; then
|
||||
AUTOUPDATE=no
|
||||
fi
|
||||
|
||||
if [ "${KEEP}" = "yes" ]; then
|
||||
echo "ERROR: KEEP is deprecated and should be removed from .plexupdate" >&2
|
||||
cronexit 255
|
||||
|
@ -265,14 +270,6 @@ if [ "${AUTOUPDATE}" = "yes" ]; then
|
|||
echo "OK"
|
||||
popd >/dev/null
|
||||
|
||||
ALLARGS2=()
|
||||
for A in ${ALLARGS[@]} ; do
|
||||
if [ ! "${A}" = "-u" ]; then
|
||||
ALLARGS2+=(${A})
|
||||
fi
|
||||
done
|
||||
ALLARGS=("${ALLARGS2[@]}")
|
||||
|
||||
if ! type "$0" 2>/dev/null >/dev/null ; then
|
||||
if [ -f "$0" ]; then
|
||||
/bin/bash "$0" -U ${ALLARGS[@]}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue