From 9c207c4c81e3c82af034e974c2d4356c98be0db6 Mon Sep 17 00:00:00 2001 From: Marcel Kapfer Date: Tue, 14 Aug 2018 13:48:30 +0200 Subject: [PATCH] KeePassXC wrapper script Unlock KeePassXC automatically using GnuPG --- scripts/keepassxc-wrapper.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100755 scripts/keepassxc-wrapper.sh diff --git a/scripts/keepassxc-wrapper.sh b/scripts/keepassxc-wrapper.sh new file mode 100755 index 0000000..fa0e269 --- /dev/null +++ b/scripts/keepassxc-wrapper.sh @@ -0,0 +1,16 @@ +#!/bin/sh + +PASSWORD_FILE=~/dotfiles/dotdotfiles/keepassxc/password.gpg +KEEPASS_FILE=~/cloud/keys/2017-10.kdbx + +if [ ! -f "$PASSWORD_FILE" ]; then + echo "No password file." + exit 1 +fi + +if [ ! -f "$KEEPASS_FILE" ]; then + echo "No KeePass file." + exit 1 +fi + +gpg --textmode -d "$PASSWORD_FILE" | keepassxc --pw-stdin "$KEEPASS_FILE"