Move ssh socket loading to .profile.
This commit is contained in:
13
.bashrc
13
.bashrc
@@ -11,19 +11,6 @@ case $- in
|
||||
esac
|
||||
[ -z "${PS1-}" ] && return
|
||||
|
||||
# lazy loading of ssh agents
|
||||
__lazy_ssh_agent() {
|
||||
if [ -z "$SSH_AUTH_SOCK" ]; then
|
||||
eval "$(ssh-agent -s)" >/dev/null
|
||||
ssh-add "$HOME/.ssh/github" >/dev/null 2>&1
|
||||
ssh-add "$HOME/.ssh/gitea" >/dev/null 2>&1
|
||||
ssh-add "$HOME/.ssh/admin@homeserver" >/dev/null 2>&1
|
||||
fi
|
||||
}
|
||||
# aliases so the function is called beforehand
|
||||
alias ssh='__lazy_ssh_agent; ssh'
|
||||
alias sudo='__lazy_ssh_agent; sudo'
|
||||
|
||||
# colourises make output, so when it prints via
|
||||
# $(warning) or $(error), it is formatted properly
|
||||
__colour_make() {
|
||||
|
||||
Reference in New Issue
Block a user