Skip to content
Permalink
Browse files

Don't supply -z unless file exists

  • Loading branch information
mernst committed Feb 8, 2020
1 parent 502b915 commit aa7420734ea99913e317118154dbecdbefb8c0b6
Showing with 7 additions and 2 deletions.
  1. +7 −2 init.sh
@@ -53,8 +53,13 @@ download_url() {
if [ "$(uname)" = "Darwin" ] ; then
wget -nv -N "$@"
else
BASENAME=`basename ${@: -1}`
timeout 300 curl -s -S -R -L -O -z "$BASENAME" "$@" || (echo "retrying curl $@" && rm -f "$BASENAME" && curl -R -L -O -z "$BASENAME" "$@")
BASENAME=`basename ${@: -1}`
if [ -f $BASENAME ]; then
ZBASENAME="-z $BASENAME"
else
ZBASENAME=""
fi
timeout 300 curl -s -S -R -L -O $ZBASENAME "$@" || (echo "retrying curl $@" && rm -f "$BASENAME" && curl -R -L -O "$@")
fi
echo "Downloaded $@"
}

0 comments on commit aa74207

Please sign in to comment.
You can’t perform that action at this time.