aboutsummaryrefslogtreecommitdiffstats
path: root/executables
diff options
context:
space:
mode:
authorEugene Triguba <eugene.triguba@paymentworks.com>2025-07-21 07:25:04 -0400
committerEugene Triguba <eugene.triguba@paymentworks.com>2025-07-21 07:25:04 -0400
commit667a1b3f42c4713096792b1a63b967b30f13d808 (patch)
treefa211ee6528d61315ca32ae847448c35bc35c92c /executables
parentup conform timeout and remove merge conflict code (diff)
parentturn off show git in tmux config (diff)
downloaddotfiles-667a1b3f42c4713096792b1a63b967b30f13d808.zip
Merge branch 'main' of https://git.sr.ht/~eugenetriguba/dotfiles
Diffstat (limited to 'executables')
-rwxr-xr-xexecutables/bin/get-password36
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 "$@"