Skip to content

Commit

Permalink
Check if gpg-agent service is enabled for ssh
Browse files Browse the repository at this point in the history
  • Loading branch information
giggio committed May 25, 2024
1 parent a1639e0 commit 984cbd1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion .bashrc
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ if $WSL; then
# forward ssh socket to Windows
export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/gnupg/ssh.sock"
else
if [ -S "$XDG_RUNTIME_DIR/gnupg/S.gpg-agent.ssh" ]; then
if [ -S "$XDG_RUNTIME_DIR/gnupg/S.gpg-agent.ssh" ] || systemctl --user is-enabled gpg-agent-ssh.socket -q &> /dev/null; then
# forward ssh socket to gpg
export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/gnupg/S.gpg-agent.ssh"
elif ! [ -v SSH_AUTH_SOCK ]; then
Expand Down

0 comments on commit 984cbd1

Please sign in to comment.