From 6e2f917375596238a85d86c4bd65ede6976b73b9 Mon Sep 17 00:00:00 2001 From: John Ankarstrom Date: Wed, 7 Jul 2021 19:28:59 +0200 Subject: .profile: Kill ssh-agent on exit --- home/john/.profile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'home/john') 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 -- cgit v1.2.3