diff options
Diffstat (limited to 'share/hydractl/ssh-finger')
-rwxr-xr-x | share/hydractl/ssh-finger | 20 |
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 |