From da57864f886550a5ad0fedbad32a64bc95f57516 Mon Sep 17 00:00:00 2001 From: Jeffrey Paul Date: Wed, 19 Oct 2016 21:39:18 -0400 Subject: [PATCH] silence error message before agent is installed --- .../etc/skel/Library/profile.d/900.gpg-agent.sh | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/custompkg/root/etc/skel/Library/profile.d/900.gpg-agent.sh b/custompkg/root/etc/skel/Library/profile.d/900.gpg-agent.sh index feec615..c8a8fc5 100644 --- a/custompkg/root/etc/skel/Library/profile.d/900.gpg-agent.sh +++ b/custompkg/root/etc/skel/Library/profile.d/900.gpg-agent.sh @@ -9,13 +9,15 @@ ssh-add -L 2>/dev/null >/dev/null || rm -f $HOME/.gpg-agent-info # if no info file, start up potentially-new, working agent if [[ ! -e $HOME/.gpg-agent-info ]]; then - gpg-agent \ - --enable-ssh-support \ - --daemon \ - --write-env-file \ - --use-standard-socket \ - --pinentry-program $(brew --prefix)/bin/pinentry-mac \ - 2>&1 >/dev/null + if which gpg-agent 2>&1 >/dev/null ; then + gpg-agent \ + --enable-ssh-support \ + --daemon \ + --write-env-file \ + --use-standard-socket \ + --pinentry-program $(brew --prefix)/bin/pinentry-mac \ + 2>&1 >/dev/null + fi fi # load up new agent info