From cedc9e7c55ca4953cb36ea70b0e66bf1ee15ec4c Mon Sep 17 00:00:00 2001 From: Alex Heneveld Date: Sun, 22 Feb 2015 17:53:34 -0800 Subject: [PATCH] improve download in bin/provision_cf fix bug where interrupted script fails, and allow it to resume --- bin/provision_cf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/provision_cf b/bin/provision_cf index 1eb8895f..66b8170f 100755 --- a/bin/provision_cf +++ b/bin/provision_cf @@ -18,7 +18,8 @@ main() { fetch_stemcell() { if [[ ! -e $STEMCELL_FILE ]] then - curl --progress-bar "${STEMCELL_SOURCE}/${STEMCELL_FILE}" > "$STEMCELL_FILE" + curl --continue-at - --progress-bar "${STEMCELL_SOURCE}/${STEMCELL_FILE}" -o "$STEMCELL_FILE.in_progress" + mv "$STEMCELL_FILE.in_progress" "$STEMCELL_FILE" fi }