1 2 3
if [ $(ps ax | grep "[s]sh-agent" | wc -l) -eq 0 ] ; then eval $(ssh-agent -s -a ${XDG_RUNTIME_DIR}/ssh-agent.sock) > /dev/null fi