diff options
author | Amin Bandali <bandali@gnu.org> | 2019-04-14 16:52:36 -0400 |
---|---|---|
committer | Amin Bandali <bandali@gnu.org> | 2019-04-14 16:52:36 -0400 |
commit | 6e39e3a24b092de97e70563e66ff08a4b8dd1674 (patch) | |
tree | dbf1dc698ecd6036314b7b7a5f0548ee75f0e9c5 | |
parent | 169b607c432b23ead7138252ab529093578c34c4 (diff) | |
download | configs-6e39e3a24b092de97e70563e66ff08a4b8dd1674.tar.gz configs-6e39e3a24b092de97e70563e66ff08a4b8dd1674.tar.xz configs-6e39e3a24b092de97e70563e66ff08a4b8dd1674.zip |
bash: start ssh-agent if not running
-rw-r--r-- | .bashrc | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -45,3 +45,10 @@ a_prompt() { printf $cwd } PS1="\u@\h \$(a_prompt)> " + +if ! pgrep -u "$USER" ssh-agent > /dev/null; then + ssh-agent > ~/.ssh-agent-thing +fi +if [[ ! "$SSH_AUTH_SOCK" ]]; then + eval "$(<~/.ssh-agent-thing)" +fi |