From 4680147f595dc5a1b0db10a5ac12486a2cc8000d Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Tue, 31 Jan 2012 21:21:09 +0100 Subject: ssh-agent-forwarding: do not spam tmp with empty temp files --- bashrc/common/ssh-agent-forwarding.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'bashrc') 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" | \ -- cgit v1.2.3