Made it compatible with any bitwarden instance

This commit is contained in:
Roger Gonzalez 2024-02-20 11:27:21 -03:00
parent 844202f960
commit 18eacf97ec
Signed by: rogs
GPG Key ID: C7ECE9C6C36EC2E6

View File

@ -1,8 +1,11 @@
#!/bin/sh
# Login to a VaultWarden instance
echo "Connecting to Vaultwarden instance at $VAULTWARDEN_URL"
bw config server "$VAULTWARDEN_URL"
# Login to a custom Bitwarden instance
if [ "$BITWARDEN_URL" ]; then
echo "Connecting to Bitwarden instance at $BITWARDEN_URL"
bw config server "$BITWARDEN_URL"
fi
BW_SESSION="$(bw login --raw)"
export BW_SESSION
@ -13,7 +16,7 @@ export BW_PATH
DATABASE_PATH="/exports/$DATABASE_NAME"
export DATABASE_PATH
# Convert the VaultWarden data to a KeePass file
# Convert the Bitwarden data to a KeePass file
bw sync
python3 bitwarden-to-keepass.py
bw lock