Use curl with options

This commit is contained in:
Girish Ramakrishnan
2016-12-28 09:48:58 -08:00
parent 1040fbddc6
commit 6fbbf0ad61
2 changed files with 2 additions and 2 deletions

View File

@@ -9,6 +9,7 @@ fi
readonly UPDATER_SERVICE="cloudron-updater"
readonly DATA_FILE="/tmp/cloudron-update-data.json"
readonly curl="curl --fail --connect-timeout 20 --retry 10 --retry-delay 2 --max-time 300"
if [[ $# == 1 && "$1" == "--check" ]]; then
echo "OK"
@@ -32,7 +33,7 @@ readonly installer_path="${box_src_tmp_dir}/scripts/installer.sh"
echo "Downloading box code from ${sourceTarballUrl} to ${box_src_tmp_dir}"
for try in `seq 1 10`; do
if curl -L "${sourceTarballUrl}" | tar -zxf - -C "${box_src_tmp_dir}"; then break; fi
if $curl -L "${sourceTarballUrl}" | tar -zxf - -C "${box_src_tmp_dir}"; then break; fi
echo "Failed to download source tarball, trying again"
sleep 5
done