From a70041a642c911b68c3efa73a675a0ec2154bb52 Mon Sep 17 00:00:00 2001 From: Scott Wallace Date: Sun, 27 Oct 2019 10:31:18 +0000 Subject: [PATCH] Simplify the SSH agent script --- .bashrc.d/ssh-agent | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/.bashrc.d/ssh-agent b/.bashrc.d/ssh-agent index c5a8fc5..ad7e02c 100644 --- a/.bashrc.d/ssh-agent +++ b/.bashrc.d/ssh-agent @@ -3,14 +3,7 @@ #-------------------------------------------------------------------------------- # Check if we already have an agent running and sourced if [ -z "${SSH_AUTH_SOCK}" ]; then - SSH_AUTH_SOCK_FILE=~/.ssh/auth_sock - if [ -S ${SSH_AUTH_SOCK_FILE} ]; then - export SSH_AUTH_SOCK=${SSH_AUTH_SOCK_FILE} - export SSH_AGENT_PID=$(cat ~/.ssh/agent.pid) - else - eval `ssh-agent -a ${SSH_AUTH_SOCK_FILE} -s` - echo ${SSH_AGENT_PID} > ~/.ssh/agent.pid - ssh-add - fi + eval $(ssh-agent) + ssh-add fi #--------------------------------------------------------------------------------