Made releng/manual_isojigdo remove .iso file after failed download

This commit is contained in:
Thomas Schmitt 2011-08-29 12:48:48 +00:00
parent 025f014241
commit 3ceb13a8ed

View File

@ -37,7 +37,7 @@ fi
# check data dir, if any and after checking -x xorriso
if [ -d "${GEN_DATA_DIR}" ]; then
printf "\n${SELF}: directory %s exists!" ${GEN_DATA_DIR}
printf "\n${SELF}: use '${SELF} -c' to remove.\n"
printf "\n${SELF}: use './${SELF} -c' to remove.\n"
exit 1
else
mkdir "${GEN_DATA_DIR}"
@ -91,9 +91,11 @@ if [ ! -f "${TMP_DATA_DIR}"/"${REMOTE_IMG}" ]; then
printf "\n${SELF}: Downloading ${REMOTE_URL}/${REMOTE_IMG}\n"
if wget -V >/dev/null 2>&1
then
set +e
wget --no-check-certificate -T20 -t3 \
-O "${TMP_DATA_DIR}"/"${REMOTE_IMG}" "${REMOTE_URL}"/"${REMOTE_IMG}"
WGET_RET="$?"
set -e
elif fetch -T 20 -o "${TMP_DATA_DIR}"/"${REMOTE_IMG}" \
"${REMOTE_URL}"/"${REMOTE_IMG}"
then
@ -110,6 +112,7 @@ if [ ! -f "${TMP_DATA_DIR}"/"${REMOTE_IMG}" ]; then
;;
*)
echo -e "\nFAIL : ${SELF} : wget returned code: $WGET_RET\n"
rm "${TMP_DATA_DIR}"/"${REMOTE_IMG}"
cleanup
exit 5
;;