aboutsummaryrefslogtreecommitdiff
path: root/bash_completions/usbkey
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2018-01-20 22:28:59 +0100
committerKarel Kočí <cynerd@email.cz>2018-01-20 22:28:59 +0100
commit9e424dae63ff66f889b8618c4fa4a6b3bf1b2012 (patch)
treebf223bdfa3985435b936a0cd786430c7336d6362 /bash_completions/usbkey
parent7e5fd86cf259a0d5ab98d3ae0081931832f8f760 (diff)
downloadmyconfigs-9e424dae63ff66f889b8618c4fa4a6b3bf1b2012.tar.gz
myconfigs-9e424dae63ff66f889b8618c4fa4a6b3bf1b2012.tar.bz2
myconfigs-9e424dae63ff66f889b8618c4fa4a6b3bf1b2012.zip
Move usbkey to separate repo
Diffstat (limited to 'bash_completions/usbkey')
-rw-r--r--bash_completions/usbkey44
1 files changed, 0 insertions, 44 deletions
diff --git a/bash_completions/usbkey b/bash_completions/usbkey
deleted file mode 100644
index acd6877..0000000
--- a/bash_completions/usbkey
+++ /dev/null
@@ -1,44 +0,0 @@
-# Bash completion file for usbkey
-# vim: ft=sh
-
-_usbkey_mounted() {
- mount | grep "/media/usbkey" | grep -q "/dev/mapper/usbkey"
-}
-
-_usbkey() {
- local cur prev
- _init_completion || return
- COMPREPLY=()
- cur="${COMP_WORDS[COMP_CWORD]}"
- if [[ $COMP_CWORD -gt 1 ]]; then
- _usbkey_mounted || return
- case "${COMP_WORDS[1]}" in
- ssh-import)
- [ -d "/media/usbkey/ssh" ] || return
- local keys
- for F in $(find "/media/usbkey/ssh" -name '*.pub'); do
- F="${F#/media/usbkey/ssh/}"
- keys="$keys ${F%.pub}"
- 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 gpg-import ssh-list ssh-generate ssh-import openvpn-list openvpn-get openvpn-generate"
- fi
- COMPREPLY+=($(compgen -W "${ops}" -- ${cur}))
- fi
-}
-
-complete -F _usbkey usbkey