mirror of
https://github.com/mrworf/plexupdate.git
synced 2025-08-20 13:23:21 -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
|
CRON=no
|
||||||
QUIET=no
|
QUIET=no
|
||||||
ARCH=$(uname -m)
|
ARCH=$(uname -m)
|
||||||
|
IGNOREAUTOUPDATE=no
|
||||||
|
|
||||||
# Default options for package managers, override if needed
|
# Default options for package managers, override if needed
|
||||||
REDHAT_INSTALL="yum -y install"
|
REDHAT_INSTALL="yum -y install"
|
||||||
|
@ -207,7 +208,7 @@ do
|
||||||
(-s) AUTOSTART=yes;;
|
(-s) AUTOSTART=yes;;
|
||||||
(-S) echo "ERROR: SILENT option has been removed, please use QUIET (-q) instead" >&2; cronexit 255;;
|
(-S) echo "ERROR: SILENT option has been removed, please use QUIET (-q) instead" >&2; cronexit 255;;
|
||||||
(-u) AUTOUPDATE=yes;;
|
(-u) AUTOUPDATE=yes;;
|
||||||
(-U) AUTOUPDATE=no;;
|
(-U) IGNOREAUTOUPDATE=yes;;
|
||||||
(--) ;;
|
(--) ;;
|
||||||
(-*) echo "ERROR: unrecognized option $1" >&2; usage; cronexit 1;;
|
(-*) echo "ERROR: unrecognized option $1" >&2; usage; cronexit 1;;
|
||||||
(*) break;;
|
(*) break;;
|
||||||
|
@ -215,6 +216,10 @@ do
|
||||||
shift
|
shift
|
||||||
done
|
done
|
||||||
|
|
||||||
|
if [ "${IGNOREAUTOUPDATE}" = "yes" ]; then
|
||||||
|
AUTOUPDATE=no
|
||||||
|
fi
|
||||||
|
|
||||||
if [ "${KEEP}" = "yes" ]; then
|
if [ "${KEEP}" = "yes" ]; then
|
||||||
echo "ERROR: KEEP is deprecated and should be removed from .plexupdate" >&2
|
echo "ERROR: KEEP is deprecated and should be removed from .plexupdate" >&2
|
||||||
cronexit 255
|
cronexit 255
|
||||||
|
@ -265,14 +270,6 @@ if [ "${AUTOUPDATE}" = "yes" ]; then
|
||||||
echo "OK"
|
echo "OK"
|
||||||
popd >/dev/null
|
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 ! type "$0" 2>/dev/null >/dev/null ; then
|
||||||
if [ -f "$0" ]; then
|
if [ -f "$0" ]; then
|
||||||
/bin/bash "$0" -U ${ALLARGS[@]}
|
/bin/bash "$0" -U ${ALLARGS[@]}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue