Browse Source

Add check for run file download failure (#40)

pull/80/head
vin01 3 years ago committed by GitHub
parent
commit
5ce80e7d78
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 15
      bitwarden.sh

15
bitwarden.sh

@ -72,9 +72,18 @@ function downloadRunFile() { @@ -72,9 +72,18 @@ function downloadRunFile() {
then
mkdir $SCRIPTS_DIR
fi
curl -L -s -o $SCRIPTS_DIR/run.sh $RUN_SCRIPT_URL
chmod u+x $SCRIPTS_DIR/run.sh
rm -f $SCRIPTS_DIR/install.sh
run_file_status_code=$(curl -s -L -w "%{http_code}" -o $SCRIPTS_DIR/run.sh $RUN_SCRIPT_URL)
if echo "$run_file_status_code" | grep -q "^20[0-9]"
then
chmod u+x $SCRIPTS_DIR/run.sh
rm -f $SCRIPTS_DIR/install.sh
else
echo "Unable to download run script from $RUN_SCRIPT_URL. Received status code: $run_file_status_code"
echo "http response:"
cat $SCRIPTS_DIR/run.sh
rm -f $SCRIPTS_DIR/run.sh
exit 1
fi
}
function checkOutputDirExists() {

Loading…
Cancel
Save