diff options
author | Timo Weingärtner <timo@tiwe.de> | 2013-06-20 16:00:08 +0200 |
---|---|---|
committer | Timo Weingärtner <timo@tiwe.de> | 2013-06-20 16:00:08 +0200 |
commit | 3db5e4a6aa2e85492638438dac5719ce633ad6f5 (patch) | |
tree | 81c03ceacdf3607768b2d8e263fcde216153dcea /afssh | |
parent | e9f27a1f6c79fddabd5995a591a8398ca645c53f (diff) | |
download | ssh-agent-filter-3db5e4a6aa2e85492638438dac5719ce633ad6f5.tar.gz |
add detection for output to terminal vs. pipe
Diffstat (limited to 'afssh')
-rwxr-xr-x | afssh | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -86,8 +86,11 @@ unset SSH_AGENT_PID trap 'kill "$SSH_AGENT_PID"; rm -r "$TEMPDIR"' EXIT TEMPDIR=$(mktemp -d) -eval $(cd "$TEMPDIR"; "$SAF" "${agent_filter_args[@]}" || echo exit $?) - -ssh-add -l +if [ -t 1 ]; then + eval $(cd "$TEMPDIR"; "$SAF" "${agent_filter_args[@]}" || echo exit $?) + ssh-add -l +else + eval $(cd "$TEMPDIR"; "$SAF" "${agent_filter_args[@]}" || echo exit $?) > /dev/null +fi ssh -A "$@" |