From 321d9a8247d50cd634615ffed707aed3f4376108 Mon Sep 17 00:00:00 2001 From: Tharre Date: Wed, 9 May 2018 02:58:18 +0200 Subject: Move various scripts and functions into bin/ --- bin/req_pwd.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100755 bin/req_pwd.sh (limited to 'bin/req_pwd.sh') diff --git a/bin/req_pwd.sh b/bin/req_pwd.sh new file mode 100755 index 0000000..3a6be86 --- /dev/null +++ b/bin/req_pwd.sh @@ -0,0 +1,19 @@ +#!/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 + +# maybe gpg-agent is acting up, retry after restarting it +gpg-connect-agent "KILLAGENT" /bye >&2 >/dev/null +gpg-connect-agent /bye >&2 >/dev/null +pass "$1" && exit + +# if pass fails, request password manually +stty -echo +printf "Password: " >&2 +read passwd +stty echo +printf "\n" >&2 + +printf "$passwd" -- cgit v1.2.3-70-g09d2