- Standardize bash shebangs to `#!/usr/bin/env bash` for portability
- Remove `function` keyword from definitions, use `func-name() {` syntax
- Replace `[ ]` conditionals with `[[ ]]` for improved functionality
- Convert local variables to lowercase with `local` keyword
- Update arithmetic comparisons to use `(( ))` syntax
- Enhance `save-dotenv-to-keepass` script with entry existence check and attachment handling
- Fix function name typo in `save-pass-to-keepass`
- Improve CSS formatting and layout for documentation
- Clean up markdown formatting in library and patterns docs
16 lines
443 B
Bash
Executable File
16 lines
443 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
save-pass-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"
|
|
}
|