--- /dev/null
+#!/usr/bin/env bash
+
+#
+# Update the value of the ~/.ssh/ssh_auth_sock symlink to point to the new
+# active socket.
+#
+# I like to use ssh-agent forwarding plus tmux. In practice, this means that
+# the first time I start tmux, it automatically knows how to talk to my
+# currently active agent. But then, when I detach tmux and log out of ssh,
+# that agent goes away. On my next ssh login, I need to tell tmux about the
+# new agent by updating this symlink. This script does that.
+#
+
+if [ -S "$SSH_AUTH_SOCK" ] && [ ! -h "$SSH_AUTH_SOCK" ]; then
+ ln -sf "$SSH_AUTH_SOCK" ~/.ssh/ssh_auth_sock
+fi
+export SSH_AUTH_SOCK=~/.ssh/ssh_auth_sock