mirror of
https://gitlab.com/Nanolx/patchimage.git
synced 2024-10-31 23:05:06 +01:00
remove temporary files when download failes
This commit is contained in:
parent
6a18fc7da2
commit
13316d3eda
@ -4,7 +4,9 @@ download_soundtrack () {
|
|||||||
|
|
||||||
if [[ ${SOUNDTRACK_LINK} && ! -f ${PATCHIMAGE_AUDIO_DIR}/${SOUNDTRACK_ZIP} ]]; then
|
if [[ ${SOUNDTRACK_LINK} && ! -f ${PATCHIMAGE_AUDIO_DIR}/${SOUNDTRACK_ZIP} ]]; then
|
||||||
wget -q --no-check-certificate "${SOUNDTRACK_LINK}" \
|
wget -q --no-check-certificate "${SOUNDTRACK_LINK}" \
|
||||||
-O "${PATCHIMAGE_AUDIO_DIR}"/"${SOUNDTRACK_ZIP}" || exit 57
|
-O "${PATCHIMAGE_AUDIO_DIR}"/"${SOUNDTRACK_ZIP}" || \
|
||||||
|
( rm "${PATCHIMAGE_AUDIO_DIR}"/"${SOUNDTRACK_ZIP}" && \
|
||||||
|
echo "downloading soundtrack failed." && exit 57 )
|
||||||
echo -e "\n >>> soundtrack saved to\n >>> ${PATCHIMAGE_AUDIO_DIR}/${SOUNDTRACK_ZIP}"
|
echo -e "\n >>> soundtrack saved to\n >>> ${PATCHIMAGE_AUDIO_DIR}/${SOUNDTRACK_ZIP}"
|
||||||
else
|
else
|
||||||
echo -e "no soundtrack for ${GAMENAME} available."
|
echo -e "no soundtrack for ${GAMENAME} available."
|
||||||
@ -44,7 +46,8 @@ download_riivolution_patch () {
|
|||||||
echo "*** >> downloading"
|
echo "*** >> downloading"
|
||||||
${GDOWN} "${DOWNLOAD_LINK}" \
|
${GDOWN} "${DOWNLOAD_LINK}" \
|
||||||
"${PATCHIMAGE_RIIVOLUTION_DIR}/${RIIVOLUTION_ZIP}"__tmp >/dev/null || \
|
"${PATCHIMAGE_RIIVOLUTION_DIR}/${RIIVOLUTION_ZIP}"__tmp >/dev/null || \
|
||||||
( echo -e "\nDownload failed!" && exit 57 )
|
( rm "${PATCHIMAGE_RIIVOLUTION_DIR}/${RIIVOLUTION_ZIP}"__tmp && \
|
||||||
|
echo -e "\nDownload failed!" && exit 57 )
|
||||||
mv "${PATCHIMAGE_RIIVOLUTION_DIR}/${RIIVOLUTION_ZIP}"__tmp \
|
mv "${PATCHIMAGE_RIIVOLUTION_DIR}/${RIIVOLUTION_ZIP}"__tmp \
|
||||||
"${PATCHIMAGE_RIIVOLUTION_DIR}/${RIIVOLUTION_ZIP}"
|
"${PATCHIMAGE_RIIVOLUTION_DIR}/${RIIVOLUTION_ZIP}"
|
||||||
echo "*** >> unpacking"
|
echo "*** >> unpacking"
|
||||||
@ -57,7 +60,8 @@ download_riivolution_patch () {
|
|||||||
${MEGADL} \
|
${MEGADL} \
|
||||||
--path="${PATCHIMAGE_RIIVOLUTION_DIR}/${RIIVOLUTION_ZIP}"__tmp \
|
--path="${PATCHIMAGE_RIIVOLUTION_DIR}/${RIIVOLUTION_ZIP}"__tmp \
|
||||||
"${DOWNLOAD_LINK}" >/dev/null || \
|
"${DOWNLOAD_LINK}" >/dev/null || \
|
||||||
( echo -e "\nDownload failed!" && exit 57 )
|
( rm "${PATCHIMAGE_RIIVOLUTION_DIR}/${RIIVOLUTION_ZIP}"__tmp && \
|
||||||
|
echo -e "\nDownload failed!" && exit 57 )
|
||||||
mv "${PATCHIMAGE_RIIVOLUTION_DIR}/${RIIVOLUTION_ZIP}"__tmp \
|
mv "${PATCHIMAGE_RIIVOLUTION_DIR}/${RIIVOLUTION_ZIP}"__tmp \
|
||||||
"${PATCHIMAGE_RIIVOLUTION_DIR}/${RIIVOLUTION_ZIP}"
|
"${PATCHIMAGE_RIIVOLUTION_DIR}/${RIIVOLUTION_ZIP}"
|
||||||
echo "*** >> unpacking"
|
echo "*** >> unpacking"
|
||||||
@ -84,7 +88,8 @@ download_riivolution_patch () {
|
|||||||
echo "*** >> downloading"
|
echo "*** >> downloading"
|
||||||
wget -q --no-check-certificate "${DOWNLOAD_LINK}" \
|
wget -q --no-check-certificate "${DOWNLOAD_LINK}" \
|
||||||
-O "${PATCHIMAGE_RIIVOLUTION_DIR}/${RIIVOLUTION_ZIP}"__tmp || \
|
-O "${PATCHIMAGE_RIIVOLUTION_DIR}/${RIIVOLUTION_ZIP}"__tmp || \
|
||||||
( echo -e "\nDownload failed!" && exit 57 )
|
( rm "${PATCHIMAGE_RIIVOLUTION_DIR}/${RIIVOLUTION_ZIP}"__tmp && \
|
||||||
|
echo -e "\nDownload failed!" && exit 57 )
|
||||||
mv "${PATCHIMAGE_RIIVOLUTION_DIR}/${RIIVOLUTION_ZIP}"__tmp \
|
mv "${PATCHIMAGE_RIIVOLUTION_DIR}/${RIIVOLUTION_ZIP}"__tmp \
|
||||||
"${PATCHIMAGE_RIIVOLUTION_DIR}/${RIIVOLUTION_ZIP}"
|
"${PATCHIMAGE_RIIVOLUTION_DIR}/${RIIVOLUTION_ZIP}"
|
||||||
echo "*** >> unpacking"
|
echo "*** >> unpacking"
|
||||||
|
Loading…
Reference in New Issue
Block a user