Group :: Text tools
RPM: gnupg2
Main Changelog Spec Patches Sources Download Gear Bugs and FR Repocop
#!/bin/sh
[ -n "${GNUPGHOME}" ] || GNUPGHOME="${HOME}/.gnupg"
if [ -r "${GNUPGHOME}/gpg.conf" ]
then
CFG="${GNUPGHOME}/gpg.conf"
else
CFG="${GNUPGHOME}/options"
fi
if grep -qs "^use-agent" ${CFG} 2>/dev/null
then
if [ -s "${GNUPGHOME}/GPG_AGENT_INFO" ] && kill -0 "`cut -d: -f2 ${GNUPGHOME}/GPG_AGENT_INFO`" 2>/dev/null
then
export GPG_AGENT_INFO="`cat ${GNUPGHOME}/GPG_AGENT_INFO`"
else
eval "`gpg-agent --daemon`"
echo $GPG_AGENT_INFO > ${GNUPGHOME}/GPG_AGENT_INFO
fi
export GPG_TTY=`tty`
fi