From 9928f9dfe990e40050eee998a2310b9741516dd5 Mon Sep 17 00:00:00 2001 From: Joe Papperello Date: Tue, 11 Sep 2018 15:59:16 +0000 Subject: [PATCH] check gpgagent --- bashrc | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/bashrc b/bashrc index 590a793..5a53bda 100644 --- a/bashrc +++ b/bashrc @@ -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