]> code.delx.au - dotfiles/commitdiff
bash: pick up SSH_AGENT in case it isn't set automatically
authorJames Bunton <jamesbunton@delx.net.au>
Fri, 14 Jul 2017 11:21:07 +0000 (21:21 +1000)
committerJames Bunton <jamesbunton@delx.net.au>
Fri, 14 Jul 2017 11:21:30 +0000 (21:21 +1000)
.bash/environment

index 63a760b2053b81187a85ce5fae9a5291de365538..8ccb665fe8e95f00fd7d5565f696e39ab7f286d2 100644 (file)
@@ -35,6 +35,11 @@ source "${HOME}/.bash/functions"
 
 pathprepend "${HOME}/bin"
 
+# Pick up SSH agent socket in case it isn't set automatically
+if [ -z "$SSH_AUTH_SOCK" ]; then
+    export SSH_AUTH_SOCK="/run/user/$(id -u)/keyring/ssh"
+fi
+
 # Load local environment settings
 [ -r "${HOME}/.bash/environment_local" ] && source "${HOME}/.bash/environment_local"