diff options
author | Alberto Gonzalez Iniesta <agi@inittab.org> | 2011-12-13 11:04:22 +0100 |
---|---|---|
committer | Alberto Gonzalez Iniesta <agi@inittab.org> | 2012-02-21 15:53:41 +0100 |
commit | 3cedd1dd9877a0bae3e69d27c3d1a2fcd98787c0 (patch) | |
tree | a1af6e31567b9a7a992bc90d6106a7cfb0c67b37 /debian/openvpn.bash_completion | |
parent | 349cfa7acb95abe865209a28e417ec74b56f9bba (diff) |
Imported Debian patch 2.2.1-1debian/2.2.1-1
Diffstat (limited to 'debian/openvpn.bash_completion')
-rw-r--r-- | debian/openvpn.bash_completion | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/debian/openvpn.bash_completion b/debian/openvpn.bash_completion new file mode 100644 index 0000000..282a3b5 --- /dev/null +++ b/debian/openvpn.bash_completion @@ -0,0 +1,23 @@ +# bash completion for openvpn init.d script +# Written by Alberto Gonzalez Iniesta <agi@inittab.org> + +_openvpn() +{ + + local cur + + COMPREPLY=() + cur=${COMP_WORDS[COMP_CWORD]} + + if [ $COMP_CWORD -eq 1 ] ; then + COMPREPLY=( $( compgen -W '$( /etc/init.d/openvpn 2>&1 \ + | cut -d"{" -f2 | tr -d "}" | tr "|" " " )' -- $cur ) ) + else + COMPREPLY=( $( compgen -W '$( command ls /etc/openvpn/*.conf 2>/dev/null \ + | sed -e 's%/etc/openvpn/%%' -e 's/\.conf//' )' -- $cur ) ) + fi + +} + + +complete -F _openvpn /etc/init.d/openvpn |