jpokorny / rpms / gnupg2

Forked from rpms/gnupg2 3 years ago
Clone
Blob Blame History Raw
#!/bin/sh
# $Id$

GPG_AGENT=$(which gpg-agent)
## Run gpg-agent only if not already running, and available
if [ -z "${GPG_AGENT_INFO}" -a -x ${GPG_AGENT} ] ; then
  if [ -f ${HOME}/.gpg-agent-info ]; then
    export GPG_AGENT_INFO=$(cat $HOME/.gpg-agent-info)
    export GPG_TTY=$(tty)
  else
    eval "$(${GPG_AGENT} -s --daemon ${GPG_OPTIONS})"
    echo $GPG_AGENT_INFO > $HOME/.gpg-agent-info
  fi
fi