Skip to content

Commit

Permalink
check gpgagent
Browse files Browse the repository at this point in the history
  • Loading branch information
Joe Papperello committed Sep 11, 2018
1 parent 38305fc commit 9928f9d
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions bashrc
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,13 @@ fd() {
cd "$dir"
}

if pgrep -x "gpg-agent" > /dev/null
then
export SSH_AUTH_SOCK=${HOME}/.gnupg/S.gpg-agent.ssh
else
eval $(gpg-agent --daemon --enable-ssh-support --sh)
if [ -x "$(command -v gpg-agent)" ]; then
if pgrep -x "gpg-agent" > /dev/null
then
export SSH_AUTH_SOCK=${HOME}/.gnupg/S.gpg-agent.ssh
else
eval $(gpg-agent --daemon --enable-ssh-support --sh)
fi
fi


Expand Down

0 comments on commit 9928f9d

Please sign in to comment.