diff --git a/extras/cronwrapper b/extras/cronwrapper index 1aba299..40f1c65 100755 --- a/extras/cronwrapper +++ b/extras/cronwrapper @@ -48,10 +48,10 @@ LOGFILE=$(mktemp /tmp/plexupdate.cron.XXXX) RET=0 if $LOGGING; then - "${SCRIPT}" --config "${CONF}" --notify-success 2>&1 | tee ${LOGFILE} | logger -t plexupdate -p daemon.info + "${SCRIPT}" "${CONF}" 2>&1 | tee ${LOGFILE} | logger -t plexupdate -p daemon.info RET="${PIPESTATUS[0]}" else - "${SCRIPT}" --config "${CONF}" --notify-success >${LOGFILE} 2>&1 + "${SCRIPT}" "${CONF}" >${LOGFILE} 2>&1 RET=$? fi diff --git a/plexupdate.sh b/plexupdate.sh index 8dd05d1..8f994ac 100755 --- a/plexupdate.sh +++ b/plexupdate.sh @@ -138,8 +138,7 @@ usage() { echo " --pass Plex.TV password" echo " --server Address of Plex Server" echo " --port Port for Plex Server. Used with --server" - echo "" - echo " --notify-success Makes plexupdate return 10 on download/update success (instead of 0)" + echo " --notify-success Set exit code 10 if update is available/installed" echo "" exit 0 } @@ -217,7 +216,7 @@ getPlexServerToken() { if [ ! -z "${I}" -a -f "${I}${PREFFILE}" ]; then sed -n 's/.*PlexOnlineToken="\([[:alnum:]]*\).*".*/\1/p' "${I}${PREFFILE}" 2>/dev/null if [ $? -ne 0 -a -z "${EMAIL}" -a -z "${PASS}" ]; then - error "Do not have permission to read token from Plex Server preference file" + error "Do not have permission to read token from Plex Server preference file (${I}${PREFFILE})" fi exit 0 fi @@ -293,7 +292,7 @@ do (--server) shift; PLEXSERVER=$(trimQuotes ${1});; (--port) shift; PLEXPORT=$(trimQuotes ${1});; - (--notify-success) shift; NOTIFY=yes;; + (--notify-success) NOTIFY=yes;; (--) ;; (-*) error "Unrecognized option $1"; usage; exit 1;; @@ -667,7 +666,7 @@ if [ "${AUTOINSTALL}" = "yes" ]; then RET=$? if [ ${RET} -ne 0 ]; then # Clarify why this failed, so user won't be left in the dark - error "Was unable to install due to problems with package from plex.tv or your local linux setup" + error "Failed to install update. Command '${DISTRO_INSTALL} "${DOWNLOADDIR}/${FILENAME}"' returned error code ${RET}" exit ${RET} fi fi