sai - localbin - leot's localbin (~/bin)
(HTM) hg clone https://bitbucket.org/iamleot/localbin
(DIR) Log
(DIR) Files
(DIR) Refs
---
sai
---
1 #!/bin/sh
2
3 #
4 # Simple script to ssh-add available keys.
5 #
6
7 : ${SSH_KEYS:="${HOME}/.ssh"}
8
9 find_options=""
10 find_options="${find_options} -type f -maxdepth 1"
11 find_options="${find_options} ! -name *.pub"
12 find_options="${find_options} ! -name authorized_keys"
13 find_options="${find_options} ! -name config"
14 find_options="${find_options} ! -name known_hosts"
15
16 fzy_options=""
17
18 k="$(find "${SSH_KEYS}" ${find_options} |
19 sort |
20 while read key; do
21 echo "${key##*/}"
22 done |
23 fzy ${fzy_options})"
24
25 echo "${k}"
26
27 if [ "${k}" ]; then
28 ssh-add "${SSH_KEYS}/${k}"
29 fi