Skip to content

Instantly share code, notes, and snippets.

@spazm
Last active January 23, 2019 20:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spazm/32c85c61d83d48dbc8a0b40e96a599bd to your computer and use it in GitHub Desktop.
Save spazm/32c85c61d83d48dbc8a0b40e96a599bd to your computer and use it in GitHub Desktop.
ssh rc file ( `.ssh/rc` ) that symlinks ssh auth sock to a known location.
MY_SSH_AUTH_SOCK=$HOME/.ssh/ssh_auth_sock
if [ -n "$SSH_AUTH_SOCK" ] ; then
if [ -L $MY_SSH_AUTH_SOCK ] && [ -e $MY_SSH_AUTH_SOCK ]; then
[ -n "$DEBUG" ] && echo "SSH_AUTH_SOCK is still valid"
else
[ -n "$DEBUG" ] && echo "linking SSH_AUTH_SOCK to $MY_SSH_AUTH_SOCK"
ln -fs "$SSH_AUTH_SOCK" "$MY_SSH_AUTH_SOCK"
fi
fi
[ -n "$DEBUG" ] && ls -l $MY_SSH_AUTH_SOCK
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment