blob: 4e17206c4e06d6fb6b79395838cd838d63735408 [file] [log] [blame]
Erich Smith55e77de2012-05-11 23:27:03 -04001cite about-plugin
2about-plugin 'ssh helper functions'
3
4function 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
14function sshlist() {
15 about 'list hosts defined in ssh config'
16 group 'ssh'
17
18 awk '$1 ~ /Host$/ { print $2 }' ~/.ssh/config
19}