dotfiles/stowers/zsh/dot-zshrc.d/02-ssh-agent.sh
Hans Goor 7ed3d3dcc8
Update SSH config to automatically add keys to agent.
Update ZSH config to automatically start the SSH agent.
2024-11-18 17:24:33 +01:00

12 lines
260 B
Bash

#!/bin/bash
if [[ -z "${SSH_CONNECTION}" ]]; then
if ! pgrep -u "$USER" ssh-agent >/dev/null; then
ssh-agent > "$TMPDIR/ssh-agent.env"
fi
if [[ ! -f "${SSH_AUTH_SOCK}" ]]; then
source "$TMPDIR/ssh-agent.env" >/dev/null
fi
fi