diff options
author | Alexander Sulfrian <alexander@sulfrian.net> | 2012-01-31 21:21:09 +0100 |
---|---|---|
committer | Alexander Sulfrian <alexander@sulfrian.net> | 2012-01-31 21:21:09 +0100 |
commit | 4680147f595dc5a1b0db10a5ac12486a2cc8000d (patch) | |
tree | df2052c056879f50277d56c4f266df4d24926b71 | |
parent | a528b0946115652b18ec51bb2f34516f7d118238 (diff) | |
download | dotfiles-4680147f595dc5a1b0db10a5ac12486a2cc8000d.tar.gz dotfiles-4680147f595dc5a1b0db10a5ac12486a2cc8000d.tar.xz dotfiles-4680147f595dc5a1b0db10a5ac12486a2cc8000d.zip |
ssh-agent-forwarding: do not spam tmp with empty temp files
-rw-r--r-- | bashrc/common/ssh-agent-forwarding.sh | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/bashrc/common/ssh-agent-forwarding.sh b/bashrc/common/ssh-agent-forwarding.sh index 2d40652..5a6c132 100644 --- a/bashrc/common/ssh-agent-forwarding.sh +++ b/bashrc/common/ssh-agent-forwarding.sh @@ -1,8 +1,8 @@ wipe_removed_sockets() { - TMPFILE=$(mktemp) - # cleanup old agent-sockets if [ -r "${HOME}/.ssh-agent-forwarding" ]; then + TMPFILE=$(mktemp) + cut -d" " -f2 "${HOME}/.ssh-agent-forwarding" | \ xargs ls -a 2>/dev/null | \ grep -f - "${HOME}/.ssh-agent-forwarding" | \ |