aboutsummaryrefslogtreecommitdiff
path: root/share/hydractl/ssh-finger
diff options
context:
space:
mode:
Diffstat (limited to 'share/hydractl/ssh-finger')
-rwxr-xr-xshare/hydractl/ssh-finger16
1 files changed, 11 insertions, 5 deletions
diff --git a/share/hydractl/ssh-finger b/share/hydractl/ssh-finger
index 0459fdd..2bf784a 100755
--- a/share/hydractl/ssh-finger
+++ b/share/hydractl/ssh-finger
@@ -33,10 +33,16 @@ if [ ! -z "$HOST" ]; then
ssh-keygen -l -f ~/.ssh/known_hosts -F $HOST
elif [ -d "/etc/ssh" ]; then
# Classic
- #for i in /etc/ssh/*.pub; do
- # ssh-keygen -l -f $i
- #done
+ 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
- # Simpler
- ls /etc/ssh/ssh_host_*.pub | xargs -n 1 ssh-keygen -l -f
+ # 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
fi