mirror of
https://github.com/lloeki/dotfiles.git
synced 2025-12-06 07:24:39 +01:00
Fix for Linux and make consistent
This commit is contained in:
parent
e317caaa8f
commit
9ca56d83c7
42 changed files with 106 additions and 52 deletions
13
shell/ssh
Normal file → Executable file
13
shell/ssh
Normal file → Executable file
|
|
@ -1,6 +1,11 @@
|
|||
# ssh keychain, if no agent set
|
||||
if [ -z "$SSH_AUTH_SOCK" ]; then
|
||||
if which envoy 2>&1 >/dev/null; then
|
||||
source <(envoy -p)
|
||||
# start ssh agent, if no agent set
|
||||
if [[ -n "${XDG_RUNTIME_DIR}" && -z "${SSH_AUTH_SOCK}" ]]; then
|
||||
if ! pgrep -u "$USER" ssh-agent > /dev/null; then
|
||||
ssh-agent -t 1h > "${XDG_RUNTIME_DIR}/ssh-agent.env"
|
||||
fi
|
||||
if [[ ! -S "${SSH_AUTH_SOCK}" ]] && [[ -f "${XDG_RUNTIME_DIR}/ssh-agent.env" ]]; then
|
||||
source "${XDG_RUNTIME_DIR}/ssh-agent.env" > /dev/null
|
||||
fi
|
||||
fi
|
||||
|
||||
# vim: ft=bash
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue