]> gitweb.fluxo.info Git - utils-ssh.git/commitdiff
Handle empty list of loaded ssh-keys
authorSilvio Rhatto <rhatto@riseup.net>
Wed, 27 Mar 2019 00:00:06 +0000 (21:00 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Wed, 27 Mar 2019 00:00:06 +0000 (21:00 -0300)
ssh-agent-loadkey

index 355a1e4ebdfbbe822b7cc84d1db34e8ed38f8d03..d3a6d37c205e2a7215c3d8c45aadc98b2486acfa 100755 (executable)
@@ -58,10 +58,13 @@ function __chooser {
   echo ""
   __list | sed -e 's/^/\t/'
   echo ""
-  echo "Current loaded keys:"
-  echo ""
-  __loaded | sed -e 's/^/\t/'
-  echo ""
+
+  if [ "`LC_ALL=C ssh-add -L`" != "The agent has no identities." ]; then
+    echo "Current loaded keys:"
+    echo ""
+    __loaded | sed -e 's/^/\t/'
+    echo ""
+  fi
 
   read -rep "Choose key: " n