aboutsummaryrefslogtreecommitdiff
path: root/bin/getpass
diff options
context:
space:
mode:
authorHimbeer <himbeer@disroot.org>2024-10-27 18:25:42 +0100
committerHimbeer <himbeer@disroot.org>2024-10-27 18:50:16 +0100
commit7a668d965b9949a6122460ed1ed749636a41bbe7 (patch)
treeb26e3238c11a80df489eedd3a4de37e485375a99 /bin/getpass
parent464cfebc6f4bd53f2959b3fe9b6e991bb271b002 (diff)
Add command-line password store utilities
Diffstat (limited to 'bin/getpass')
-rwxr-xr-xbin/getpass9
1 files changed, 9 insertions, 0 deletions
diff --git a/bin/getpass b/bin/getpass
new file mode 100755
index 0000000..94460df
--- /dev/null
+++ b/bin/getpass
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+PASS=$(grep --color=never "$1" ~/.passdb | awk -F' = ' '{print $2}')
+
+if [ -z "${PASS}" ]; then
+ exit 1
+fi
+
+echo "${PASS}"