Fix ssh-agent

This commit is contained in:
John Mertz 2023-08-11 12:19:58 -04:00
parent 978daa7c10
commit 4edd9a297d
1 changed files with 1 additions and 1 deletions

View File

@ -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