Fix ssh-agent
This commit is contained in:
parent
978daa7c10
commit
4edd9a297d
|
@ -3,8 +3,8 @@
|
||||||
if [ -e "${HOME}/.spool/ssh-agent.sock" ]; then
|
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/')
|
PID=$(tail -n 1 "${HOME}/.spool/ssh-agent.env" | sed 's/echo Agent pid \([0-9]*\);/\1/')
|
||||||
if [ -z "$PID" ]; then
|
if [ -z "$PID" ]; then
|
||||||
|
rm "${HOME}/.spool/ssh-agent.sock" "${HOME}/.spool/ssh-agent.pid" 2>/dev/null
|
||||||
pkill ssh-agent
|
pkill ssh-agent
|
||||||
rm "${HOME}/.spool/ssh-agent.sock" "${HOME}/.spool/ssh-agent.pid"
|
|
||||||
else
|
else
|
||||||
CMD=$(ps -p "$PID" -o comm | tail -n 1)
|
CMD=$(ps -p "$PID" -o comm | tail -n 1)
|
||||||
if [ -n "$CMD" ] && [ "$CMD" == 'ssh-agent' ]; then
|
if [ -n "$CMD" ] && [ "$CMD" == 'ssh-agent' ]; then
|
||||||
|
|
Loading…
Reference in New Issue