Skip to content

Commit 984cbd1

Browse files
committed
Check if gpg-agent service is enabled for ssh
1 parent a1639e0 commit 984cbd1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

.bashrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ if $WSL; then
130130
# forward ssh socket to Windows
131131
export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/gnupg/ssh.sock"
132132
else
133-
if [ -S "$XDG_RUNTIME_DIR/gnupg/S.gpg-agent.ssh" ]; then
133+
if [ -S "$XDG_RUNTIME_DIR/gnupg/S.gpg-agent.ssh" ] || systemctl --user is-enabled gpg-agent-ssh.socket -q &> /dev/null; then
134134
# forward ssh socket to gpg
135135
export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/gnupg/S.gpg-agent.ssh"
136136
elif ! [ -v SSH_AUTH_SOCK ]; then

0 commit comments

Comments
 (0)