]> git.madduck.net Git - etc/pass.git/blob - .bin/pass

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

add wrapper for passphrase preseeding
[etc/pass.git] / .bin / pass
1 #!/bin/sh
2 set -eu
3
4 real_pass() {
5   local OLDIFS; OLDIFS="$IFS"
6   IFS=:
7   local SELF; SELF="$(realpath $0)"
8   local CMD; CMD="$(basename "$SELF")"
9   local ret; ret=127
10   for p in $PATH; do
11     case "$SELF" in ($p/*) continue;; esac
12     if [ -x "$p/$CMD" ]; then
13       ${exec:-} "$p/$CMD" "$@"
14       ret=$?
15       break
16     fi
17   done
18   IFS="$OLDIFS"
19   return $ret
20 }
21
22 KEYGRIP=083F1106EEDD459ED7761C825FDB3E60FA7D8F3F
23
24 gpg-connect-agent "keyinfo $KEYGRIP" /bye | while read a b c d e f g h; do
25   if [ "$g" != 1 ]; then
26     real_pass .meta/pass-key | /usr/lib/gnupg/gpg-preset-passphrase -c $KEYGRIP
27   fi
28   break
29 done
30
31 exec=exec real_pass "$@"