iomenu-ssh - iomenu - interactive terminal-based selection menu
(HTM) git clone git://bitreich.org/iomenu git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/iomenu
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) Tags
(DIR) README
(DIR) LICENSE
---
iomenu-ssh (313B)
---
1 #!/bin/sh -eu
2 # SSH connect to a host in ~/.ssh/known_hosts and /etc/hosts
3
4 etc_hosts=$(awk '/^[ \t]*[^#]/ { for (i = 2; i <= NF; i++) print $i }' /etc/hosts)
5 known_hosts=$(awk '{ print $1 }' "$HOME/.ssh/known_hosts")
6 host=$(printf '%s\n' $etc_hosts $known_hosts | sort -u | iomenu)
7
8 test -n "$host"
9
10 ssh "$host"