projects
/
~bandali
/
configs
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
169b607
)
bash: start ssh-agent if not running
author
Amin Bandali
<bandali@gnu.org>
Sun, 14 Apr 2019 20:52:36 +0000
(16:52 -0400)
committer
Amin Bandali
<bandali@gnu.org>
Sun, 14 Apr 2019 20:52:36 +0000
(16:52 -0400)
.bashrc
patch
|
blob
|
blame
|
history
diff --git
a/.bashrc
b/.bashrc
index
f4fa270
..
309cbd1
100644
(file)
--- a/
.bashrc
+++ b/
.bashrc
@@
-45,3
+45,10
@@
a_prompt() {
printf $cwd
}
PS1="\u@\h \$(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