server
server copied to clipboard
update procedure breaks bitwarden.sh if Github servers don't respond as expected
I have a simple cron job that executes bitwarden.sh updateself and bitwarden.sh update every two hours, to keem the system up to date.
After it ran the last time, my bitwarden.sh was broken - it only contained this line:
500: Internal Server Error
Fixing it was quite simple (just downloaded the current version with wget -qObitwarden.sh https://raw.githubusercontent.com/bitwarden/server/master/scripts/bitwarden.sh), but I stronlgy recommend changing the update process to something like:
- download the new file with a temporary file name
- verify the file's consistency (i.e. by comparing it's sha256 hash)
- actually replace the old file with the downloaded file
This just happened again.