diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2019-03-26 21:00:06 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2019-03-26 21:00:06 -0300 |
commit | 99310bbcf4cf4a6adf581c560fea444884f8af98 (patch) | |
tree | 89d1481dd9cab8043eec0b14375eb23e7d2767d2 | |
parent | e9820ca672d714e68df6e5d0ccaa98c00f9ef554 (diff) | |
download | utils-ssh-99310bbcf4cf4a6adf581c560fea444884f8af98.tar.gz utils-ssh-99310bbcf4cf4a6adf581c560fea444884f8af98.tar.bz2 |
Handle empty list of loaded ssh-keys
-rwxr-xr-x | ssh-agent-loadkey | 11 |
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 |