From 37a3b9896ddcead0d0d0c0eb3f7654e594e02042 Mon Sep 17 00:00:00 2001 From: logan2611 Date: Wed, 26 Feb 2020 17:31:21 -0700 Subject: [PATCH] Added ssh-agent autostart --- .bashrc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.bashrc b/.bashrc index 25cea4b..5bb39ea 100644 --- a/.bashrc +++ b/.bashrc @@ -5,6 +5,12 @@ # If not running interactively, don't do anything [[ $- != *i* ]] && return +if ! pgrep -u "$USER" ssh-agent > /dev/null; then + ssh-agent > "$XDG_RUNTIME_DIR/ssh-agent.env" +fi +if [[ ! "$SSH_AUTH_SOCK" ]]; then + eval "$(<"$XDG_RUNTIME_DIR/ssh-agent.env")" +fi alias ls='ls --color=auto' alias grep='grep --color=auto'