Created
March 16, 2015 11:08
-
-
Save leonjza/a09da92fd64b46c35f73 to your computer and use it in GitHub Desktop.
Update Tmux SSH_AUTH_SOCK
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
update_auth_sock() { | |
local socket_path="$(tmux show-environment | sed -n 's/^SSH_AUTH_SOCK=//p')" | |
if ! [[ "$socket_path" ]]; then | |
echo 'no socket path' >&2 | |
return 1 | |
else | |
export SSH_AUTH_SOCK="$socket_path" | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment