Created
August 7, 2014 06:15
-
-
Save minisu/85f05d65e75dc21c1c85 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /etc/X11/Xsession.d/90gpg-agent | |
: ${GNUPGHOME=$HOME/.gnupg} | |
GPGAGENT=/usr/bin/gpg-agent | |
# Original, not working: PID_FILE="$GNUPGHOME/gpg-agent-info-$(hostname)" | |
PID_FILE="$GNUPGHOME/gpg-agent-info" | |
if grep -qs '^[[:space:]]*use-agent' "$GNUPGHOME/gpg.conf" "$GNUPGHOME/options" && | |
test -x $GPGAGENT && | |
{ test -z "$GPG_AGENT_INFO" || ! $GPGAGENT 2>/dev/null; }; then | |
if [ -r "$PID_FILE" ]; then | |
. "$PID_FILE" | |
fi | |
# Invoking gpg-agent with no arguments exits successfully if the agent | |
# is already running as pointed by $GPG_AGENT_INFO | |
if ! $GPGAGENT 2>/dev/null; then | |
STARTUP="$GPGAGENT --daemon --sh --write-env-file=$PID_FILE $STARTUP" | |
fi | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment