Only initialize gpg-agent if it's not an SSH connection or a toolbox

This commit is contained in:
Sam A. 2023-03-13 13:31:42 +01:00
parent 42f1b4c84b
commit 6936cab5c2
Signed by: samsapti
GPG Key ID: CBBBE7371E81C4EA
1 changed files with 6 additions and 4 deletions

View File

@ -1,4 +1,6 @@
export GPG_TTY="$TTY"
export SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)"
gpgconf --launch gpg-agent
gpg-connect-agent updatestartuptty /bye &> /dev/null
if [[ -z $SSH_CONNECTION ]] && [[ $HOSTNAME != "toolbox" ]]; then
export GPG_TTY="$TTY"
export SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)"
gpgconf --launch gpg-agent
gpg-connect-agent updatestartuptty /bye &> /dev/null
fi