Made releng/manual_isojigdo remove .iso file after failed download
This commit is contained in:
parent
75d8b3b8df
commit
6c5ec5138c
@ -37,7 +37,7 @@ fi
|
|||||||
# check data dir, if any and after checking -x xorriso
|
# check data dir, if any and after checking -x xorriso
|
||||||
if [ -d "${GEN_DATA_DIR}" ]; then
|
if [ -d "${GEN_DATA_DIR}" ]; then
|
||||||
printf "\n${SELF}: directory %s exists!" ${GEN_DATA_DIR}
|
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
|
exit 1
|
||||||
else
|
else
|
||||||
mkdir "${GEN_DATA_DIR}"
|
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"
|
printf "\n${SELF}: Downloading ${REMOTE_URL}/${REMOTE_IMG}\n"
|
||||||
if wget -V >/dev/null 2>&1
|
if wget -V >/dev/null 2>&1
|
||||||
then
|
then
|
||||||
|
set +e
|
||||||
wget --no-check-certificate -T20 -t3 \
|
wget --no-check-certificate -T20 -t3 \
|
||||||
-O "${TMP_DATA_DIR}"/"${REMOTE_IMG}" "${REMOTE_URL}"/"${REMOTE_IMG}"
|
-O "${TMP_DATA_DIR}"/"${REMOTE_IMG}" "${REMOTE_URL}"/"${REMOTE_IMG}"
|
||||||
WGET_RET="$?"
|
WGET_RET="$?"
|
||||||
|
set -e
|
||||||
elif fetch -T 20 -o "${TMP_DATA_DIR}"/"${REMOTE_IMG}" \
|
elif fetch -T 20 -o "${TMP_DATA_DIR}"/"${REMOTE_IMG}" \
|
||||||
"${REMOTE_URL}"/"${REMOTE_IMG}"
|
"${REMOTE_URL}"/"${REMOTE_IMG}"
|
||||||
then
|
then
|
||||||
@ -110,6 +112,7 @@ if [ ! -f "${TMP_DATA_DIR}"/"${REMOTE_IMG}" ]; then
|
|||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo -e "\nFAIL : ${SELF} : wget returned code: $WGET_RET\n"
|
echo -e "\nFAIL : ${SELF} : wget returned code: $WGET_RET\n"
|
||||||
|
rm "${TMP_DATA_DIR}"/"${REMOTE_IMG}"
|
||||||
cleanup
|
cleanup
|
||||||
exit 5
|
exit 5
|
||||||
;;
|
;;
|
||||||
|
Loading…
Reference in New Issue
Block a user