aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimo Weingärtner <timo@tiwe.de>2013-06-20 15:54:30 +0200
committerTimo Weingärtner <timo@tiwe.de>2013-06-20 15:54:30 +0200
commit6064fef975a261aab7e92792c2a83687ae1fdb9e (patch)
tree3fce2c1fd0378555c759983a178984b5577b1ea8
parent07557734129cd53acb5eff9d59b0d6144925e3e7 (diff)
downloadssh-agent-filter-6064fef975a261aab7e92792c2a83687ae1fdb9e.tar.gz
afssh: add safeguard against empty or non-running ssh-agent
-rwxr-xr-xafssh5
1 files changed, 5 insertions, 0 deletions
diff --git a/afssh b/afssh
index 84b8545..609e61f 100755
--- a/afssh
+++ b/afssh
@@ -31,6 +31,11 @@ usage () {
exit
}
+if ! ssh-add -l > /dev/null; then
+ echo "no keys in your ssh-agent or ssh-agent not running" >&2
+ exit 1
+fi
+
declare -a agent_filter_args
if [ -x "${BASH_SOURCE%/*}/ssh-agent-filter" ]; then