install.sh: fail on download errors

This patch makes install.sh always run curl with flag "-f"
so it fails on download errors.
This commit is contained in:
Ivan Andreev 2021-03-23 01:09:48 +03:00
parent 088a83872d
commit 1406b6c3c9
1 changed files with 3 additions and 3 deletions

View File

@ -53,9 +53,9 @@ export XDG_CONFIG_HOME=config
#check installed version of rclone to determine if update is necessary #check installed version of rclone to determine if update is necessary
version=$(rclone --version 2>>errors | head -n 1) version=$(rclone --version 2>>errors | head -n 1)
if [ -z "$install_beta" ]; then if [ -z "$install_beta" ]; then
current_version=$(curl https://downloads.rclone.org/version.txt) current_version=$(curl -f https://downloads.rclone.org/version.txt)
else else
current_version=$(curl https://beta.rclone.org/version.txt) current_version=$(curl -f https://beta.rclone.org/version.txt)
fi fi
if [ "$version" = "$current_version" ]; then if [ "$version" = "$current_version" ]; then
@ -123,7 +123,7 @@ else
rclone_zip="rclone-beta-latest-${OS}-${OS_type}.zip" rclone_zip="rclone-beta-latest-${OS}-${OS_type}.zip"
fi fi
curl -O "$download_link" curl -Of "$download_link"
unzip_dir="tmp_unzip_dir_for_rclone" unzip_dir="tmp_unzip_dir_for_rclone"
# there should be an entry in this switch for each element of unzip_tools_list # there should be an entry in this switch for each element of unzip_tools_list
case "$unzip_tool" in case "$unzip_tool" in