Start ssh-agent only in interactive sessions

This commit is contained in:
2018-09-23 15:56:55 +02:00
parent dc2fea5cd5
commit 31e5d05805

View File

@@ -273,8 +273,10 @@ cod() { # colordiff replacement with git
}
if [ -z "$SSH_AUTH_SOCK" ]; then
eval `ssh-agent -s`
trap 'kill $SSH_AGENT_PID' EXIT
if [[ $- == *i* ]]; then
eval `ssh-agent -s`
trap 'kill $SSH_AGENT_PID' EXIT
fi
fi
if [ -r ~/.bashrc_local ]; then