diff options
author | Patrick McDermott <patrick.mcdermott@libiquity.com> | 2019-04-16 23:03:07 (EDT) |
---|---|---|
committer | Patrick McDermott <patrick.mcdermott@libiquity.com> | 2019-04-16 23:03:07 (EDT) |
commit | 6c35678d1990e9195b7bda9437d58f77fa9c65de (patch) | |
tree | 730306ad79d2466347c003321f574acc59f09bbe | |
parent | 3b6ed0d8f142b9b48b3852f94be4e9a9a3ee094b (diff) |
feed_download(): Check for errors
-rw-r--r-- | src/feed.sh | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/feed.sh b/src/feed.sh index 356902e..5f8d86b 100644 --- a/src/feed.sh +++ b/src/feed.sh @@ -48,7 +48,14 @@ feed_download() url="${base_url}/Packages" fi - ${WGET} -q -O - "${url}" | ${gunzip} >"${list_file}" + if ! ${WGET} -q -O "${list_file}.tmp" "${url}"; then + return 1 + fi + if ! ${gunzip} <"${list_file}.tmp" >"${list_file}"; then + rm -f "${list_file}.tmp" + return 1 + fi + rm -f "${list_file}.tmp" return 0 } |