From dbcca138bc83b7d62ac3402deda5b90edfde8ded Mon Sep 17 00:00:00 2001 From: kdeppe Date: Mon, 15 Aug 2022 11:09:34 -0400 Subject: [PATCH] proper ssh-agent killing --- bin/agent.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/agent.sh b/bin/agent.sh index fee93e6..86ba177 100755 --- a/bin/agent.sh +++ b/bin/agent.sh @@ -7,12 +7,12 @@ if [ -z $SSH_AGENT_SOCK ] ; then if [ -e ~/.ssh/id_ed25519 ] ; then ssh-add ~/.ssh/id_ed25519 else - kill $SSH_AGENT_PID echo -e "No ed25519 keys found! Killing $SSH_AGENT_PID!" + eval $(ssh-agent -k) fi else - kill $SSH_AGENT_PID echo "Killing $SSH_AGENT_PID!" + eval $(ssh-agent -k) fi fi