#!/bin/sh set -eu real_pass() { local OLDIFS; OLDIFS="$IFS" IFS=: local SELF; SELF="$(realpath $0)" local CMD; CMD="$(basename "$SELF")" local ret; ret=127 for p in $PATH; do case "$SELF" in ($p/*) continue;; esac if [ -x "$p/$CMD" ]; then ${exec:-} "$p/$CMD" "$@" ret=$? break fi done IFS="$OLDIFS" return $ret } KEYGRIP=083F1106EEDD459ED7761C825FDB3E60FA7D8F3F gpg-connect-agent "keyinfo $KEYGRIP" /bye | while read a b c d e f g h; do if [ "$g" != 1 ]; then real_pass .meta/pass-key | /usr/lib/gnupg/gpg-preset-passphrase -c $KEYGRIP fi break done exec=exec real_pass "$@"