aboutsummaryrefslogtreecommitdiff
path: root/home/john
diff options
context:
space:
mode:
authorJohn Ankarstrom <john@ankarstrom.se>2021-07-07 19:28:59 +0200
committerJohn Ankarstrom <john@ankarstrom.se>2021-07-07 19:37:26 +0200
commit6e2f917375596238a85d86c4bd65ede6976b73b9 (patch)
treead6fea56b06d5812dea0984afc85570bbd0dfc88 /home/john
parent88d26ba2adeafbe42a9c4791ba0a4f71d720ac4a (diff)
downloadlbsd-6e2f917375596238a85d86c4bd65ede6976b73b9.tar.gz
.profile: Kill ssh-agent on exit
Diffstat (limited to 'home/john')
-rw-r--r--home/john/.profile5
1 files changed, 4 insertions, 1 deletions
diff --git a/home/john/.profile b/home/john/.profile
index dea5bb8..2f145a6 100644
--- a/home/john/.profile
+++ b/home/john/.profile
@@ -48,4 +48,7 @@ export LC_ALL=en_US.ISO8859-1
export RTV_BROWSER=w3m
export CHOICES=~/.choices
-! pgrep ssh-agent 1>/dev/null && eval `ssh-agent`
+if [ -z "$SSH_AGENT_PID" ]; then
+ eval `ssh-agent`
+ trap "kill $SSH_AGENT_PID" EXIT
+fi