mirror of
https://github.com/mrworf/plexupdate.git
synced 2025-08-14 02:26:56 -07:00
Do not depend on filename var
This commit is contained in:
parent
256ece32f3
commit
c4a2ee4480
1 changed files with 5 additions and 5 deletions
|
@ -365,7 +365,7 @@ function cleanup {
|
|||
rm /tmp/raw 2>/dev/null >/dev/null
|
||||
rm /tmp/failcause 2>/dev/null >/dev/null
|
||||
rm /tmp/kaka 2>/dev/null >/dev/null
|
||||
rm "/tmp/${FILENAME}.sha" 2>/dev/null >/dev/null
|
||||
rm "/tmp/package.sha" 2>/dev/null >/dev/null
|
||||
}
|
||||
trap cleanup EXIT
|
||||
|
||||
|
@ -471,7 +471,7 @@ if [ $? -ne 0 ]; then
|
|||
cronexit 3
|
||||
fi
|
||||
|
||||
echo "${CHECKSUM} ${DOWNLOADDIR}/${FILENAME}" >"/tmp/${FILENAME}.sha"
|
||||
echo "${CHECKSUM} ${DOWNLOADDIR}/${FILENAME}" >"/tmp/package.sha"
|
||||
|
||||
if [ "${PRINT_URL}" = "yes" ]; then
|
||||
if [ "${QUIET}" = "yes" ]; then
|
||||
|
@ -502,7 +502,7 @@ fi
|
|||
|
||||
if [ -f "${DOWNLOADDIR}/${FILENAME}" ]; then
|
||||
if [ "${FORCE}" != "yes" -a "${FORCEALL}" != "yes" ]; then
|
||||
sha1sum --status -c "/tmp/${FILENAME}.sha"
|
||||
sha1sum --status -c "/tmp/package.sha"
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "File already exists (${FILENAME}), won't download."
|
||||
if [ "${AUTOINSTALL}" != "yes" ]; then
|
||||
|
@ -516,7 +516,7 @@ if [ -f "${DOWNLOADDIR}/${FILENAME}" ]; then
|
|||
elif [ "${FORCEALL}" == "yes" ]; then
|
||||
echo "Note! File exists, but asked to overwrite with new copy"
|
||||
else
|
||||
sha1sum --status -c "/tmp/${FILENAME}.sha"
|
||||
sha1sum --status -c "/tmp/package.sha"
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Note! File exists but fails checksum. Redownloading."
|
||||
else
|
||||
|
@ -540,7 +540,7 @@ if [ "${SKIP_DOWNLOAD}" = "no" ]; then
|
|||
echo "OK"
|
||||
fi
|
||||
|
||||
sha1sum --status -c "/tmp/${FILENAME}.sha"
|
||||
sha1sum --status -c "/tmp/package.sha"
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Downloaded file corrupt. Try again."
|
||||
cronexit 4
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue