Make sure the file we download is non-zero size

This commit is contained in:
Steve McIntyre 2014-01-19 23:46:46 +00:00
parent 277be3a9bf
commit 053d79d158
1 changed files with 7 additions and 1 deletions

View File

@ -29,4 +29,10 @@ fi
DIR=$(dirname "$WANTED") DIR=$(dirname "$WANTED")
mkdir -p "$MIRROR/$DIR" 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