Redirect the output of GPG and SSH agent plugins
This commit is contained in:
parent
6ac5c25e77
commit
7a745425c4
@ -13,14 +13,14 @@ if (( ! $+commands[gpg-agent] )); then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
function _gpg-agent-start() {
|
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}"
|
chmod 600 "${_gpg_env}"
|
||||||
source "${_gpg_env}"
|
source "${_gpg_env}" > /dev/null
|
||||||
}
|
}
|
||||||
|
|
||||||
# Source GPG agent settings, if applicable.
|
# Source GPG agent settings, if applicable.
|
||||||
if [[ -f "${_gpg_env}" ]]; then
|
if [[ -f "${_gpg_env}" ]]; then
|
||||||
source "${_gpg_env}"
|
source "${_gpg_env}" > /dev/null
|
||||||
ps -ef | grep "${SSH_AGENT_PID}" | grep -q 'gpg-agent' || {
|
ps -ef | grep "${SSH_AGENT_PID}" | grep -q 'gpg-agent' || {
|
||||||
_gpg-agent-start
|
_gpg-agent-start
|
||||||
}
|
}
|
||||||
|
@ -30,13 +30,11 @@ function _ssh-agent-start() {
|
|||||||
rm -f "${_ssh_agent_env}"
|
rm -f "${_ssh_agent_env}"
|
||||||
ssh-agent > "${_ssh_agent_env}"
|
ssh-agent > "${_ssh_agent_env}"
|
||||||
chmod 600 "${_ssh_agent_env}"
|
chmod 600 "${_ssh_agent_env}"
|
||||||
source "${_ssh_agent_env}"
|
source "${_ssh_agent_env}" > /dev/null
|
||||||
|
|
||||||
# Load identies.
|
# Load identies.
|
||||||
zstyle -a ':omz:plugin:ssh-agent' identities 'identities'
|
zstyle -a ':omz:plugin:ssh-agent' identities 'identities'
|
||||||
|
|
||||||
print starting ssh-agent...
|
|
||||||
|
|
||||||
if [[ ! -n "${identities}" ]]; then
|
if [[ ! -n "${identities}" ]]; then
|
||||||
ssh-add
|
ssh-add
|
||||||
else
|
else
|
||||||
@ -51,7 +49,7 @@ if is-true "${_ssh_agent_forwarding}" && [[ -n "$SSH_AUTH_SOCK" ]]; then
|
|||||||
[[ -L "$SSH_AUTH_SOCK" ]] || ln -sf "$SSH_AUTH_SOCK" /tmp/ssh-agent-$USER-screen
|
[[ -L "$SSH_AUTH_SOCK" ]] || ln -sf "$SSH_AUTH_SOCK" /tmp/ssh-agent-$USER-screen
|
||||||
elif [ -f "${_ssh_agent_env}" ]; then
|
elif [ -f "${_ssh_agent_env}" ]; then
|
||||||
# Source SSH settings, if applicable.
|
# Source SSH settings, if applicable.
|
||||||
source "${_ssh_agent_env}"
|
source "${_ssh_agent_env}" > /dev/null
|
||||||
ps -ef | grep "${SSH_AGENT_PID}" | grep -q 'ssh-agent$' || {
|
ps -ef | grep "${SSH_AGENT_PID}" | grep -q 'ssh-agent$' || {
|
||||||
_ssh-agent-start;
|
_ssh-agent-start;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user