mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-10-01 01:26:01 -04:00
e3c7b570ae
* Remove mention of no longer used IRC network Channels exist on matrix, and on libera.chat now. * Correctly match only files with .png extension The current search would match files such as 'createpng'. * Fix comparison in script The result was always false, due to comparing a literal string instead of a variable. * Use correct license files from upstream Correct license files obtained from: https://www.gnu.org/licenses/old-licenses/gpl-2.0.txt https://www.gnu.org/licenses/gpl-3.0.txt https://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt https://www.gnu.org/licenses/lgpl-3.0.txt * Refresh several shell scripts This fixes several shellcheck warnings, as well as makes the code more robust and have consistent codestyle between all the files. * Trim excess whitespace
30 lines
762 B
Bash
Executable File
30 lines
762 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# fetch KeePass database passwords from keychain
|
|
|
|
### change the path to suit your installation or set KDBX_SEARCH before calling ###
|
|
: ${KDBX_SEARCH:=~/.KeePass/*.kdbx}
|
|
|
|
PROG=$(basename "$0")
|
|
KeePassXC=$(ls -f {/usr/local,/Applications}/KeePassXC.app/Contents/MacOS/KeePassXC 2>/dev/null | head -1)
|
|
|
|
daemon_main() {
|
|
declare -A DBs
|
|
for DBPATH in $KDBX_SEARCH; do
|
|
DBs[$(python -c "import os; print os.path.realpath('$DBPATH')")]=$(security find-generic-password -a $USER -s "${DBPATH##*/}" -w)
|
|
done
|
|
|
|
# launch keepassxc
|
|
IFS=$'\n\n\n'
|
|
$KeePassXC --pw-stdin "${!DBs[@]}" <<<"${DBs[*]}" &
|
|
}
|
|
|
|
if [[ $1 == '-d' ]]; then
|
|
exec >&~/tmp/$PROG.log
|
|
set -vx
|
|
daemon_main
|
|
else
|
|
cd /
|
|
daemon_main </dev/null >&/dev/null &
|
|
disown
|
|
fi
|