aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/%HOME%/.bash_profile
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2016-10-29 08:02:28 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2016-10-29 08:02:28 +0300
commit1d7e419ac64c0ba026246fac058ef843c560eea7 (patch)
tree19bec975bc8135e8c9e500c251c3a57fcb8dd112 /%HOME%/.bash_profile
parentremove more dead code from bash dotfiles (diff)
downloadlinux-home-1d7e419ac64c0ba026246fac058ef843c560eea7.tar.gz
linux-home-1d7e419ac64c0ba026246fac058ef843c560eea7.zip
bugfix & code style
Diffstat (limited to '')
-rw-r--r--%HOME%/.bash_profile9
1 files changed, 5 insertions, 4 deletions
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