Erich Smith | 55e77de | 2012-05-11 23:27:03 -0400 | [diff] [blame] | 1 | cite about-plugin |
2 | about-plugin 'ssh helper functions' | ||||
3 | |||||
4 | function add_ssh() { | ||||
5 | about 'add entry to ssh config' | ||||
6 | param '1: host' | ||||
7 | param '2: hostname' | ||||
8 | param '3: user' | ||||
9 | group 'ssh' | ||||
10 | |||||
11 | echo -en "\n\nHost $1\n HostName $2\n User $3\n ServerAliveInterval 30\n ServerAliveCountMax 120" >> ~/.ssh/config | ||||
12 | } | ||||
13 | |||||
14 | function sshlist() { | ||||
15 | about 'list hosts defined in ssh config' | ||||
16 | group 'ssh' | ||||
17 | |||||
18 | awk '$1 ~ /Host$/ { print $2 }' ~/.ssh/config | ||||
19 | } |