aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2019-03-26 21:00:06 -0300
committerSilvio Rhatto <rhatto@riseup.net>2019-03-26 21:00:06 -0300
commit99310bbcf4cf4a6adf581c560fea444884f8af98 (patch)
tree89d1481dd9cab8043eec0b14375eb23e7d2767d2
parente9820ca672d714e68df6e5d0ccaa98c00f9ef554 (diff)
downloadutils-ssh-99310bbcf4cf4a6adf581c560fea444884f8af98.tar.gz
utils-ssh-99310bbcf4cf4a6adf581c560fea444884f8af98.tar.bz2
Handle empty list of loaded ssh-keys
-rwxr-xr-xssh-agent-loadkey11
1 files changed, 7 insertions, 4 deletions
diff --git a/ssh-agent-loadkey b/ssh-agent-loadkey
index 355a1e4..d3a6d37 100755
--- a/ssh-agent-loadkey
+++ b/ssh-agent-loadkey
@@ -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