From 4edd9a297db9adbb7bd389c8794ff70c17c0d8b0 Mon Sep 17 00:00:00 2001 From: John Mertz Date: Fri, 11 Aug 2023 12:19:58 -0400 Subject: [PATCH] Fix ssh-agent --- ssh-agent.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ssh-agent.sh b/ssh-agent.sh index 2e44d2f..5ca32c4 100755 --- a/ssh-agent.sh +++ b/ssh-agent.sh @@ -3,8 +3,8 @@ if [ -e "${HOME}/.spool/ssh-agent.sock" ]; then PID=$(tail -n 1 "${HOME}/.spool/ssh-agent.env" | sed 's/echo Agent pid \([0-9]*\);/\1/') if [ -z "$PID" ]; then + rm "${HOME}/.spool/ssh-agent.sock" "${HOME}/.spool/ssh-agent.pid" 2>/dev/null pkill ssh-agent - rm "${HOME}/.spool/ssh-agent.sock" "${HOME}/.spool/ssh-agent.pid" else CMD=$(ps -p "$PID" -o comm | tail -n 1) if [ -n "$CMD" ] && [ "$CMD" == 'ssh-agent' ]; then