- Add `get-pass-from-keepass` script to retrieve passwords from KeePass entries - Add `save-pass-to-keepass` script to store passwords in KeePass entries - Update library.md documentation with new KeePass utility functions - Include usage examples and descriptions for new password management tools
16 lines
445 B
Bash
Executable File
16 lines
445 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
save-dotenv-to-keepass() {
|
|
if [[ -z "$1" ]]; then echo "\$1 is empty."; exit; fi
|
|
if [[ -z "$2" ]]; then echo "\$2 is empty."; exit; fi
|
|
local password="$1"
|
|
local keepass_entry="$2"
|
|
|
|
echo "Save password to keepass entry: $keepass_entry"
|
|
keepassxc-cli add \
|
|
--key-file "$KEEPASS_DATABASE_KEY_FILE" \
|
|
--password "$password" \
|
|
"$KEEPASS_DATABASE_FILE" \
|
|
"$KEEPASS_ENTRY"
|
|
}
|