aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2018-07-18 12:43:28 -0300
committerSilvio Rhatto <rhatto@riseup.net>2018-07-18 12:43:28 -0300
commit5a3c8624f2f3bbcc62aef6c0fc1717897ce2ee36 (patch)
treea868e08a9f11b96b7505b966e1f5fc7516f4c73b
parenta8b706ccdab40635d7a48bcc85df3176cd24c0d8 (diff)
downloadhydra-5a3c8624f2f3bbcc62aef6c0fc1717897ce2ee36.tar.gz
hydra-5a3c8624f2f3bbcc62aef6c0fc1717897ce2ee36.tar.bz2
Fixes ssh-finger
-rwxr-xr-xshare/hydractl/ssh-finger20
1 files changed, 9 insertions, 11 deletions
diff --git a/share/hydractl/ssh-finger b/share/hydractl/ssh-finger
index 2bf784a..c262e79 100755
--- a/share/hydractl/ssh-finger
+++ b/share/hydractl/ssh-finger
@@ -30,19 +30,17 @@ if [ ! -z "$HOST" ]; then
ssh-keygen -l -f /etc/ssh/ssh_known_hosts -F $HOST
fi
- ssh-keygen -l -f ~/.ssh/known_hosts -F $HOST
+ if [ -f "$HOME/.ssh/known_hosts" ]; then
+ ssh-keygen -l -f $HOME/.ssh/known_hosts -F $HOST
+ fi
elif [ -d "/etc/ssh" ]; then
# Classic
- if [ -d "/etc/ssh" ]; then
- for i in /etc/ssh/*.pub; do
- if [ -e "/etc/ssh/$i" ]; then
- ssh-keygen -l -f $i
- fi
- done
- fi
+ for i in /etc/ssh/*.pub; do
+ if [ -e "$i" ]; then
+ ssh-keygen -l -f $i
+ fi
+ done
# Simpler, but might trow errors if there's no keys
- #if [ -d "/etc/ssh" ]; then
- # ls /etc/ssh/ssh_host_*.pub | xargs -n 1 ssh-keygen -l -f
- #fi
+ #ls /etc/ssh/ssh_host_*.pub | xargs -n 1 ssh-keygen -l -f
fi