diff options
author | Alexander Sulfrian <alexander@sulfrian.net> | 2009-02-08 00:57:31 +0100 |
---|---|---|
committer | Alexander Sulfrian <alexander@sulfrian.net> | 2009-02-08 00:57:31 +0100 |
commit | 9c3bb67a76025b70a65b9626dfdb24baf1073a26 (patch) | |
tree | ab7ae0837758ef7896755b785a8dd4efdb775925 | |
parent | 5a4886a4807094e0b65da77d9b16906844612b03 (diff) | |
download | dotfiles-9c3bb67a76025b70a65b9626dfdb24baf1073a26.tar.gz dotfiles-9c3bb67a76025b70a65b9626dfdb24baf1073a26.tar.xz dotfiles-9c3bb67a76025b70a65b9626dfdb24baf1073a26.zip |
removed fixssh
- symlink agend-socket on connect
- other handling after that is manuell
-rw-r--r-- | bashrc/common/ssh-agent-forwarding.sh | 34 |
1 files changed, 2 insertions, 32 deletions
diff --git a/bashrc/common/ssh-agent-forwarding.sh b/bashrc/common/ssh-agent-forwarding.sh index 511aec3..4691578 100644 --- a/bashrc/common/ssh-agent-forwarding.sh +++ b/bashrc/common/ssh-agent-forwarding.sh @@ -15,41 +15,11 @@ if [ -n "$SSH_AUTH_SOCK" -a -n "$SSH_CLIENT" ]; then # add current socket echo "$(date +%s) $SSH_AUTH_SOCK $SSH_CLIENT" >> "${HOME}/.ssh-agent-forwarding" + ln -sf "$SSH_AUTH_SOCK" "${HOME}/.ssh-agent-forwarded-sock" + fi if [ -z "$SSH_AUTH_SOCK" -a -r "${HOME}/.ssh-agent-forwarding" ]; then SSH_AUTH_SOCK=$(tail -n 1 "${HOME}/.ssh-agent-forwarding" | cut -d" " -f2) export SSH_AUTH_SOCK fi - -fixssh() { - if [ ! -r "${HOME}/.ssh-agent-forwarding" ]; then - echo "No ssh-agent forwardings found." - return 1 - fi - - if [ -z "$1" -o "$1" == "latest" ]; then - SSH_AUTH_SOCK=$(tail -n 1 "${HOME}/.ssh-agent-forwarding" | cut -d" " -f2) - else - REMOTE=$(echo $1 | grep -o "[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}") - - if [[ "$REMOTE" == "$1" ]]; then - SSH_AUTH_SOCK=$(grep " $REMOTE " "${HOME}/.ssh-agent-forwarding" | head -n 1 | cut -d" " -f2) - else - REMOTE=$(dig +short "$1" | tr '\n' ' ') - - if [ -n "${REMOTE}" ]; then - SSH_AUTH_SOCK=$(grep " ${REMOTE##*: } " "${HOME}/.ssh-agent-forwarding" | head -n 1 | cut -d" " -f2) - else - SSH_AUTH_SOCK=$(grep "$1" "${HOME}/.ssh-agent-forwarding" | head -n 1 | cut -d" " -f2) - fi - fi - fi - - if [ -z "$SSH_AUTH_SOCK" ]; then - echo "Nothing found!" - return 1 - fi - - export SSH_AUTH_SOCK -} |