mirror of
https://github.com/lloeki/dotfiles.git
synced 2025-12-06 15:34:40 +01:00
11 lines
399 B
Bash
Executable file
11 lines
399 B
Bash
Executable file
# 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
|