diff --git a/files/.bashrc b/files/.bashrc index 4a66609..85add80 100644 --- a/files/.bashrc +++ b/files/.bashrc @@ -29,11 +29,9 @@ alias cp='cp -i' # ask before removal alias mv='mv -i' # ask before removal # ============================== SSH-Agent -if [ -f ~/.ssh/agent.env ]; then - . ~/.ssh/agent.env > /dev/null -else +if ! [ -S /tmp/marc-agent.sock ]; then echo "Starting ssh-agent" - eval `ssh-agent | tee ~/.ssh/agent.env` + ssh-agent -a /tmp/marc-agent.sock ssh-add fi diff --git a/files/.profile b/files/.profile index 3dd4044..aa2a763 100755 --- a/files/.profile +++ b/files/.profile @@ -4,9 +4,7 @@ export PATH=$PATH:$HOME/scripts:$HOME/.cargo/bin:$HOME/.cabal/bin:$HOME/.ghcup/bin:$HOME/.local/bin # ssh -if [ -f ~/.ssh/agent.env ] ; then - . ~/.ssh/agent.env > /dev/null -fi +export SSH_AUTH_SOCK=/tmp/marc-agent.sock # editor export EDITOR="vim" diff --git a/files/.zprofile b/files/.zprofile deleted file mode 100755 index a2c42ef..0000000 --- a/files/.zprofile +++ /dev/null @@ -1 +0,0 @@ -. ~/.profile diff --git a/files/.zshrc b/files/.zshrc index c989199..5bef00a 100644 --- a/files/.zshrc +++ b/files/.zshrc @@ -98,17 +98,10 @@ setopt share_history # share command history data inside tmux export HISTFILE="$HOME/.zsh_history" export SAVEHIST=5000 -# ============================== SSH-Agent -if [ -f ~/.ssh/agent.env ] ; then - . ~/.ssh/agent.env > /dev/null - if ! kill -0 $SSH_AGENT_PID > /dev/null 2>&1; then - echo "Stale agent file found. Spawning a new agent. " - eval `ssh-agent | tee ~/.ssh/agent.env` - ssh-add - fi -else +# ============================== ssh-agent +if ! [ -S /tmp/marc-agent.sock ]; then echo "Starting ssh-agent" - eval `ssh-agent | tee ~/.ssh/agent.env` + ssh-agent -a /tmp/marc-agent.sock ssh-add fi