From 8271fc85f3e1bf60a9c0badd0e309618dc80b15a Mon Sep 17 00:00:00 2001 From: Alex Keizer Date: Mon, 2 Jan 2023 00:41:49 +0100 Subject: [PATCH] Preserve permission bits on updateself --- bitwarden.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bitwarden.sh b/bitwarden.sh index aad4fc0..650fcb7 100755 --- a/bitwarden.sh +++ b/bitwarden.sh @@ -60,6 +60,9 @@ echo "" function downloadSelf() { if curl -L -s -w "http_code %{http_code}" -o $SCRIPT_PATH.1 $BITWARDEN_SCRIPT_URL | grep -q "^http_code 20[0-9]" then + if [ -e $SCRIPT_PATH ]; then + chmod --reference $SCRIPT_PATH $SCRIPT_PATH.1 + fi mv -f $SCRIPT_PATH.1 $SCRIPT_PATH chmod u+x $SCRIPT_PATH else