diff options
| author | Eugene Triguba <eugene.triguba@paymentworks.com> | 2025-07-21 07:25:04 -0400 |
|---|---|---|
| committer | Eugene Triguba <eugene.triguba@paymentworks.com> | 2025-07-21 07:25:04 -0400 |
| commit | 667a1b3f42c4713096792b1a63b967b30f13d808 (patch) | |
| tree | fa211ee6528d61315ca32ae847448c35bc35c92c /executables | |
| parent | up conform timeout and remove merge conflict code (diff) | |
| parent | turn off show git in tmux config (diff) | |
| download | dotfiles-667a1b3f42c4713096792b1a63b967b30f13d808.zip | |
Merge branch 'main' of https://git.sr.ht/~eugenetriguba/dotfiles
Diffstat (limited to 'executables')
| -rwxr-xr-x | executables/bin/get-password | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/executables/bin/get-password b/executables/bin/get-password new file mode 100755 index 0000000..3b83bb7 --- /dev/null +++ b/executables/bin/get-password @@ -0,0 +1,36 @@ +#!/bin/sh +set -e + +VAULT="Private" +CREDENTIAL="" + +main() { + parse_args "$@" + op read "op://$VAULT/$CREDENTIAL/password" +} + +parse_args() { + while [ $# -gt 0 ]; do + case "$1" in + --vault) + VAULT="$2" + shift 2 + ;; + --credential) + CREDENTIAL="$2" + shift 2 + ;; + *) + echo "Usage: $0 [--vault <name>] --credential <name>" + exit 1 + ;; + esac + done + + if [ -z "$CREDENTIAL" ]; then + echo "Invalid or empty CREDENTIAL" >&2 + exit 1 + fi +} + +main "$@" |