From dd30417fdba18a97945459b29e88cbbedb07874c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Mon, 18 Sep 2017 23:13:31 +0200 Subject: Add openvpn to usbkey --- bash_completions/usbkey | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'bash_completions') 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 -- cgit v1.2.3