From e6526ab59652554a4cdb83d61d4a9e20be2a5165 Mon Sep 17 00:00:00 2001 From: Mart124 <37041094+Mart124@users.noreply.github.com> Date: Mon, 4 May 2020 21:44:38 +0200 Subject: [PATCH] Properly download bitwarden.sh (#720) --- scripts/bitwarden.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/scripts/bitwarden.sh b/scripts/bitwarden.sh index 6c09e8c1f..92ee08a06 100755 --- a/scripts/bitwarden.sh +++ b/scripts/bitwarden.sh @@ -43,8 +43,13 @@ WEBVERSION="2.13.2" # Functions function downloadSelf() { - curl -s -o $SCRIPT_PATH $GITHUB_BASE_URL/scripts/bitwarden.sh - chmod u+x $SCRIPT_PATH + if curl -s -w "http_code %{http_code}" -o $SCRIPT_PATH.1 $GITHUB_BASE_URL/scripts/bitwarden.sh | grep -q "^http_code 20[0-9]" + then + mv $SCRIPT_PATH.1 $SCRIPT_PATH + chmod u+x $SCRIPT_PATH + else + rm -f $SCRIPT_PATH.1 + fi } function downloadRunFile() {