From 053d79d158c6f048d9e808d6bce248bef690515a Mon Sep 17 00:00:00 2001 From: Steve McIntyre Date: Sun, 19 Jan 2014 23:46:46 +0000 Subject: [PATCH] Make sure the file we download is non-zero size --- tools/grab_file | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/grab_file b/tools/grab_file index 24b260ca..3f5d7af1 100755 --- a/tools/grab_file +++ b/tools/grab_file @@ -29,4 +29,10 @@ fi DIR=$(dirname "$WANTED") mkdir -p "$MIRROR/$DIR" -wget -o /tmp/log -q "$HTTPMIRROR/$WANTED" -O "$MIRROR/$WANTED" +wget -o /tmp/log "$HTTPMIRROR/$WANTED" -O "$MIRROR/$WANTED" + +# Check that the file is non-zero in size +if [ -e "$MIRROR/$WANTED" ] && [ ! -s "$MIRROR/$WANTED" ] ; then + rm -f "$MIRROR/$WANTED" +fi +