summaryrefslogtreecommitdiffstats
path: root/.req_pwd.sh
diff options
context:
space:
mode:
authorTharre <tharre3@gmail.com>2017-03-26 01:30:13 +0100
committerTharre <tharre3@gmail.com>2017-03-26 01:30:13 +0100
commitfec7a1961ceaf7c9019623ce00ed47569dfcf27f (patch)
treedfa5da7015f0fe921e7c714c1e95998fc1cabbe3 /.req_pwd.sh
parent9ea9200f95af98a2f4b5d363e3e3439d9ed861bc (diff)
downloaddotfiles-fec7a1961ceaf7c9019623ce00ed47569dfcf27f.tar.gz
dotfiles-fec7a1961ceaf7c9019623ce00ed47569dfcf27f.tar.xz
dotfiles-fec7a1961ceaf7c9019623ce00ed47569dfcf27f.zip
Enter passwords manually if pass is not available
Diffstat (limited to '.req_pwd.sh')
-rwxr-xr-x.req_pwd.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/.req_pwd.sh b/.req_pwd.sh
new file mode 100755
index 0000000..bce131b
--- /dev/null
+++ b/.req_pwd.sh
@@ -0,0 +1,14 @@
+#!/bin/sh -e
+# A simple wrapper script to deal with situations where pass, password-store, or
+# my gpg key is not available.
+
+pass "$1" && exit
+
+# if pass fails, request password manually
+stty -echo
+printf "Password: " >&2
+read passwd
+stty echo
+printf "\n" >&2
+
+printf "$passwd"