Update ssh agent things
This commit is contained in:
13
files/.zshrc
13
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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user