gnupg2/gpg-agent-startup.sh
Rex Dieter dfe3a6a6a3 - include gpg-agent-(startup|shutdown) scripts (#136533)
- BR: libksba-devel >= 1.9.12
2005-12-01 19:53:39 +00:00

15 lines
404 B
Bash
Executable File

#!/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