]> arthur.barton.de Git - ConfigScripts.git/blobdiff - user/bash_logout
Add support for keychain(1) ssh-agent and gpg-agent helper
[ConfigScripts.git] / user / bash_logout
index 80c8d841103e732e1edbb0ccb368d918b756379c..3b258553e95e4e63b6047906d12f15e9c43c2b81 100644 (file)
 
 [ -r ~/.bash_logout.user ] && source ~/.bash_logout.user
 
-# Clean up SSH agents, if running
-[ $SSH_AGENT_PID ] && eval `ssh-agent -k`
+# Clean up SSH agents, if running and not using keychain(1)
+if [ $SSH_AGENT_PID ]; then
+       type keychain >/dev/null 2>&1 || eval `ssh-agent -k`
+fi
 
-# Clear console, it it is local terminal
+# Clear the console if it is a local terminal
 case `tty` in
     /dev/tty[0-9]*|/dev/ttyS[0-9]*)
        [ -x /usr/bin/clear_console ] && /usr/bin/clear_console --quiet || clear