Added agent startup script

nvim
Keegan 2 years ago
parent bc94309b57
commit acb8107178

@ -0,0 +1,18 @@
#!/usr/bin/env bash
# makes sure agent is active and adds keys
if [ -z $SSH_AGENT_SOCK ] ; then
# agent unset
eval $(ssh-agent -s)
if [ "$(ssh-add -l)" = "The agent has no identities." ] ; then
if [ -e ~/.ssh/id_ed25519 ] ; then
ssh-add ~/.ssh/id_ed25519
else
kill $SSH_AGENT_PID
echo -e "No ed25519 keys found! Killing $SSH_AGENT_PID!"
fi
else
kill $SSH_AGENT_PID
echo "Killing $SSH_AGENT_PID!"
fi
fi

@ -134,4 +134,5 @@ export PATH=$PATH:$HOME/.local/bin
# ranger alias
alias ranger="python3 $HOME/.ranger.py"
#adding ranger to path
# adding agent startup alias
alias agent="source $HOME/.dotfiles/bin/agent.sh"

Loading…
Cancel
Save