From 1d7e419ac64c0ba026246fac058ef843c560eea7 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Sat, 29 Oct 2016 08:02:28 +0300 Subject: bugfix & code style --- %HOME%/.bash_profile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to '%HOME%/.bash_profile') diff --git a/%HOME%/.bash_profile b/%HOME%/.bash_profile index b545321..bb4d98e 100644 --- a/%HOME%/.bash_profile +++ b/%HOME%/.bash_profile @@ -1,13 +1,14 @@ -[ -f "$HOME/.bashrc" ] && source "$HOME/.bashrc" +[ -r "$HOME/.bashrc" ] && source "$HOME/.bashrc" echo "Welcome to $( hostname )" spawn_ssh_agent() { [ -n "${SSH_AGENT_PID:+x}" ] && return 0 - eval "$( ssh-agent -s )" > /dev/null \ - && trap "$( printf 'kill %q' "$SSH_AGENT_PID" )" 0 \ - && ssh-add &> /dev/null + command -v ssh-agent &> /dev/null \ + && eval "$( ssh-agent -s )" > /dev/null \ + && [ -n "${SSH_AGENT_PID:+x}" ] \ + && trap "$( printf 'kill %q' "$SSH_AGENT_PID" )" 0 } [ "$( uname -o )" == 'Cygwin' ] && spawn_ssh_agent -- cgit v1.2.3