From 7b6dbb921650e2a52929f025b67be57609fda6d4 Mon Sep 17 00:00:00 2001 From: Eugene Triguba Date: Sat, 20 Dec 2025 10:53:14 -0500 Subject: Rework dotfiles to *only* contain dotfiles --- .local/bin/get-password | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100755 .local/bin/get-password (limited to '.local/bin/get-password') diff --git a/.local/bin/get-password b/.local/bin/get-password new file mode 100755 index 0000000..3b83bb7 --- /dev/null +++ b/.local/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 ] --credential " + exit 1 + ;; + esac + done + + if [ -z "$CREDENTIAL" ]; then + echo "Invalid or empty CREDENTIAL" >&2 + exit 1 + fi +} + +main "$@" -- cgit v1.2.3