Deprecated exit code 5 and corrcted cronwrapper and enhanced README (#148)

* Deprecated exit code 5 and corrcted cronwrapper and enhanced README

- plexupdate.sh will consider no new version as success
- cronwrapper will not print anything unless it truly fails
- README.md updated to provide more details about .plexupdate

* Moved text from README.md to wiki and added notifyonreturn to cron

* Removed overthought part
This commit is contained in:
Henric Andersson 2016-12-11 15:10:23 -08:00 committed by GitHub
commit 440de0cfe5
3 changed files with 11 additions and 11 deletions

8
README.md Normal file → Executable file
View file

@ -161,6 +161,10 @@ But here are some of the more useful ones:
See explanation in the top of this document. See explanation in the top of this document.
## Do I have to use the `extras/installer.sh` ?
Of course not, anything you find under `extras/` is optional and only provided as a easier way to get `plexupdate.sh` up and running quickly.
## What email and password are you talking about ## What email and password are you talking about
The email and password for http://plex.tv The email and password for http://plex.tv
@ -172,3 +176,7 @@ If you use certain characters (such as `$`) in your password, bash will interpre
i.e. `PASS="MyP4$$w0rD"` will not work, but changing to it to `PASS='MyP4$$w0rD'` will i.e. `PASS="MyP4$$w0rD"` will not work, but changing to it to `PASS='MyP4$$w0rD'` will
If it's still not working, run `plexupdate.sh` with `-v` which prints out the email and password used to login which might help you understand what the problem is. If it's still not working, run `plexupdate.sh` with `-v` which prints out the email and password used to login which might help you understand what the problem is.
# Not finding what you're looking for?
See https://github.com/mrworf/plexupdate/wiki for more information

View file

@ -14,10 +14,6 @@
# LOGGING if true, logs all output to syslog daemon facility # LOGGING if true, logs all output to syslog daemon facility
# (typically /var/log/daemon.log or /var/log/syslog) # (typically /var/log/daemon.log or /var/log/syslog)
# #
# Set CONFIGURED to true once you've setup the previous three
# options.
#
if [ ! -f /etc/plexupdate.cron.conf ]; then if [ ! -f /etc/plexupdate.cron.conf ]; then
echo "ERROR: You have not configured /etc/plexupdate.cron.conf" >&2 echo "ERROR: You have not configured /etc/plexupdate.cron.conf" >&2
@ -59,12 +55,9 @@ else
RET=$? RET=$?
fi fi
if [ $RET -ne 2 -a $RET -ne 5 ]; then if [ $RET -ne 0 ] ; then
# Make sure user gets an email about this # Make sure user gets an email about this (when not success or if user has specified when)
cat ${LOGFILE} >&2 cat ${LOGFILE} >&2
else
# Nah, not important
RET=0
fi fi
rm "${LOGFILE}" 2>/dev/null rm "${LOGFILE}" 2>/dev/null

View file

@ -24,7 +24,6 @@
# 2 if file already downloaded # 2 if file already downloaded
# 3 if page layout has changed. # 3 if page layout has changed.
# 4 if download fails # 4 if download fails
# 5 if version already installed
# 6 if update was deferred due to usage # 6 if update was deferred due to usage
# #
# All other return values not documented. # All other return values not documented.
@ -563,7 +562,7 @@ fi
if [[ $FILENAME == *$INSTALLED_VERSION* ]] && [ "${FORCE}" != "yes" -a "${FORCEALL}" != "yes" ] && [ ! -z "${INSTALLED_VERSION}" ]; then if [[ $FILENAME == *$INSTALLED_VERSION* ]] && [ "${FORCE}" != "yes" -a "${FORCEALL}" != "yes" ] && [ ! -z "${INSTALLED_VERSION}" ]; then
info "Your OS reports the latest version of Plex ($INSTALLED_VERSION) is already installed. Use -f to force download." info "Your OS reports the latest version of Plex ($INSTALLED_VERSION) is already installed. Use -f to force download."
exit 5 exit 0
fi fi
if [ -f "${DOWNLOADDIR}/${FILENAME}" ]; then if [ -f "${DOWNLOADDIR}/${FILENAME}" ]; then