diff options
author | Jack Thomasson <thomasso@adobe.com> | 2016-10-25 19:18:23 +0300 |
---|---|---|
committer | Jack Thomasson <thomasso@adobe.com> | 2016-10-25 19:18:23 +0300 |
commit | 3ec29d3b52181dbe20aacaff6290d40d89703d9c (patch) | |
tree | 5ad637e58f059d6ae92ed137f50ed3e0940bebfa /utils | |
parent | 01382090046f8560c96d20e84b872dba940a0981 (diff) |
search directory configured via environment
use absolute path to database file
Diffstat (limited to 'utils')
-rwxr-xr-x | utils/keepassx-kwallet | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/utils/keepassx-kwallet b/utils/keepassx-kwallet index 7fcb0af69..e0cdcda5e 100755 --- a/utils/keepassx-kwallet +++ b/utils/keepassx-kwallet @@ -1,5 +1,8 @@ #!/bin/bash +### change the path to suit your installation or set KDBX_SEARCH before calling ### +: ${KDBX_SEARCH:=~/.KeePass/*.kdbx} + PROG="$(basename $0)" function daemon_main { @@ -11,8 +14,8 @@ function daemon_main { # fetch KeePass database passwords from kdewallet declare -A DBs - ### change the path to suit your installation ### - for DBPATH in ~/.keepassx/*.kdbx; do + for DBPATH in $KDBX_SEARCH; do + [[ -L "$DBPATH" ]] && DBPATH=$(readlink --canonicalize "$DBPATH") DBs[$DBPATH]=$(qdbus org.kde.kwalletd5 /modules/kwalletd5 org.kde.KWallet.readPassword "$handle" "Passwords" "$DBPATH" "$PROG") done |