Redirect the output of GPG and SSH agent plugins

This commit is contained in:
Sorin Ionescu 2012-03-07 18:05:01 -05:00
commit 7a745425c4
2 changed files with 5 additions and 7 deletions

View file

@ -13,14 +13,14 @@ if (( ! $+commands[gpg-agent] )); then
fi
function _gpg-agent-start() {
gpg-agent --daemon --enable-ssh-support --write-env-file "${_gpg_env}"
gpg-agent --daemon --enable-ssh-support --write-env-file "${_gpg_env}" > /dev/null
chmod 600 "${_gpg_env}"
source "${_gpg_env}"
source "${_gpg_env}" > /dev/null
}
# Source GPG agent settings, if applicable.
if [[ -f "${_gpg_env}" ]]; then
source "${_gpg_env}"
source "${_gpg_env}" > /dev/null
ps -ef | grep "${SSH_AGENT_PID}" | grep -q 'gpg-agent' || {
_gpg-agent-start
}