mirror of
https://github.com/mrworf/plexupdate.git
synced 2025-08-19 04:49:34 -07:00
Fixes for cronwrapper behavior (#138)
* Fix cronwrapper failing if CONF is specified * Exit code 0 means an update was applied, so we should send output * Make sure wget log gets cleaned up along with other temp files * Fix cronwrapper showing unwanted output even while logging
This commit is contained in:
parent
5c48315fa4
commit
760ad2b564
2 changed files with 4 additions and 4 deletions
|
@ -39,7 +39,7 @@ if [ ! -z "$CONF" ]; then
|
||||||
echo "ERROR: Cannot find config file (tried ${CONF})" >&2
|
echo "ERROR: Cannot find config file (tried ${CONF})" >&2
|
||||||
exit 255
|
exit 255
|
||||||
fi
|
fi
|
||||||
CONF="--config \"${CONF}\""
|
CONF="--config=${CONF}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
LOGFILE=$(mktemp /tmp/plexupdate.cron.XXXX)
|
LOGFILE=$(mktemp /tmp/plexupdate.cron.XXXX)
|
||||||
|
@ -51,11 +51,11 @@ if $LOGGING; then
|
||||||
RET=1
|
RET=1
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
"${SCRIPT}" "${CONF}" 2>&1 >${LOGFILE}
|
"${SCRIPT}" "${CONF}" >${LOGFILE} 2>&1
|
||||||
RET=$?
|
RET=$?
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $RET -ne 0 -a $RET -ne 2 -a $RET -ne 5 ]; then
|
if [ $RET -ne 2 -a $RET -ne 5 ]; then
|
||||||
# Make sure user gets an email about this
|
# Make sure user gets an email about this
|
||||||
cat ${LOGFILE} >&2
|
cat ${LOGFILE} >&2
|
||||||
else
|
else
|
||||||
|
|
|
@ -192,7 +192,7 @@ keypair() {
|
||||||
|
|
||||||
# Setup an exit handler so we cleanup
|
# Setup an exit handler so we cleanup
|
||||||
cleanup() {
|
cleanup() {
|
||||||
for F in "${FILE_RAW}" "${FILE_FAILCAUSE}" "${FILE_POSTDATA}" "${FILE_KAKA}" "${FILE_SHA}" "${FILE_LOCAL}" "${FILE_REMOTE}"; do
|
for F in "${FILE_RAW}" "${FILE_FAILCAUSE}" "${FILE_POSTDATA}" "${FILE_KAKA}" "${FILE_SHA}" "${FILE_LOCAL}" "${FILE_REMOTE}" "${FILE_WGETLOG}"; do
|
||||||
rm "$F" 2>/dev/null >/dev/null
|
rm "$F" 2>/dev/null >/dev/null
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue