diff options
author | Karel Kočí <cynerd@email.cz> | 2017-09-18 23:13:31 +0200 |
---|---|---|
committer | Karel Kočí <cynerd@email.cz> | 2017-09-18 23:13:31 +0200 |
commit | dd30417fdba18a97945459b29e88cbbedb07874c (patch) | |
tree | a87b8dc76ab4b7ea5298bb55dc9abb9b6cc7fb25 /bash_completions/usbkey | |
parent | 3370e45b1c4a6c476827e9467fb1d313bb9a2319 (diff) | |
download | myconfigs-dd30417fdba18a97945459b29e88cbbedb07874c.tar.gz myconfigs-dd30417fdba18a97945459b29e88cbbedb07874c.tar.bz2 myconfigs-dd30417fdba18a97945459b29e88cbbedb07874c.zip |
Add openvpn to usbkey
Diffstat (limited to 'bash_completions/usbkey')
-rw-r--r-- | bash_completions/usbkey | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/bash_completions/usbkey b/bash_completions/usbkey index 10cb0b9..acd6877 100644 --- a/bash_completions/usbkey +++ b/bash_completions/usbkey @@ -22,11 +22,20 @@ _usbkey() { done COMPREPLY+=($(compgen -W "${keys}" -- ${cur})) ;; + openvpn-get) + [ -d "/media/usbkey/openvpn" ] || return + local certs + for F in $(find "/media/usbkey/openvpn" -name 'ca.crt' -o -name '*.crt' -print); do + F="${F#/media/usbkey/openvpn/}" + certs="$certs ${F%.crt}" + done + COMPREPLY+=($(compgen -W "${certs}" -- ${cur})) + ;; esac else local ops="-h --help mount sync" if _usbkey_mounted; then - ops="$ops unmount ssh-list ssh-generate ssh-import" + ops="$ops unmount gpg-import ssh-list ssh-generate ssh-import openvpn-list openvpn-get openvpn-generate" fi COMPREPLY+=($(compgen -W "${ops}" -- ${cur})) fi |