From: Alexander Barton Date: Fri, 18 Apr 2014 13:43:00 +0000 (+0200) Subject: Add support for keychain(1) ssh-agent and gpg-agent helper X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=ConfigScripts.git;a=commitdiff_plain;h=f3abe3aedbb390e92d94357f86acd37c442565a8 Add support for keychain(1) ssh-agent and gpg-agent helper --- diff --git a/sys/bashrc b/sys/bashrc index 09947a8..911327f 100644 --- a/sys/bashrc +++ b/sys/bashrc @@ -9,6 +9,10 @@ BASHRCREAD="true" [ -z "$PROFILEREAD" -a -r /etc/profile ] && source /etc/profile +# Initialize keychain(1) ssh-agent and gpg-agent helper +type keychain >/dev/null 2>&1 \ + && eval `keychain --agents ssh --eval --quick --quiet` + # Interactive shell? [ "$PS1" ] || return diff --git a/user/bash_logout b/user/bash_logout index b2e4f09..3b25855 100644 --- a/user/bash_logout +++ b/user/bash_logout @@ -14,8 +14,10 @@ [ -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 the console if it is a local terminal case `tty` in