diff options
author | Oscar Najera <hi@oscarnajera.com> | 2023-09-18 13:07:47 +0200 |
---|---|---|
committer | Oscar Najera <hi@oscarnajera.com> | 2023-09-18 13:08:03 +0200 |
commit | e6f0937525ea7f31443c2100291f75fa9015a92e (patch) | |
tree | 7257a2c5f80ee08c5e9b49e9459fc8279b382d6f /home-dots/dot-bashrc | |
parent | 6ab15660d71e6d1ecc8c850a4c8c4433d604d89a (diff) | |
download | dotfiles-e6f0937525ea7f31443c2100291f75fa9015a92e.tar.gz dotfiles-e6f0937525ea7f31443c2100291f75fa9015a92e.tar.bz2 dotfiles-e6f0937525ea7f31443c2100291f75fa9015a92e.zip |
ssh agent only on non ssh sessions
This is in the case I log into a machine that has its own agent.
I want to have my forwarded agent.
Diffstat (limited to 'home-dots/dot-bashrc')
-rw-r--r-- | home-dots/dot-bashrc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/home-dots/dot-bashrc b/home-dots/dot-bashrc index ae13f2b..1641221 100644 --- a/home-dots/dot-bashrc +++ b/home-dots/dot-bashrc @@ -68,9 +68,11 @@ PROMPT_COMMAND=__prompt_command export EDITOR='emacsclient' # GPG agent with ssh -unset SSH_AGENT_PID -if [ "${gnupg_SSH_AUTH_SOCK_by:-0}" -ne $$ ]; then - export SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)" +if [ -z "$SSH_CLIENT" ]; then + unset SSH_AGENT_PID + if [ "${gnupg_SSH_AUTH_SOCK_by:-0}" -ne $$ ]; then + export SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)" + fi fi # For python lsp |