commit 6da4170ee2e1446ef7d4672d65fb6ec67443ac75
parent a281cad5de5519a894466d355faad5581035e58d
Author: Chris Bracken <chris@bracken.jp>
Date: Wed, 22 Apr 2020 15:53:59 -0700
Start ssh-agent in .profile
Required on systems that don't use a session manager like systemd.
Diffstat:
1 file changed, 7 insertions(+), 0 deletions(-)
diff --git a/.zprofile b/.zprofile
@@ -2,3 +2,10 @@
# Set the terminal size if we're on a serial line.
if [[ -x /usr/bin/resizewin ]]; then /usr/bin/resizewin -z; fi
+
+# Start ssh-agent daemon.
+export SSH_AUTH_SOCK=~/.ssh/ssh-agent.$HOST.sock
+ssh-add -l 2>/dev/null >/dev/null
+if [ $? -ge 2 ]; then
+ ssh-agent -a "$SSH_AUTH_SOCK" >/dev/null
+fi