Initial commit

This commit is contained in:
2025-09-14 11:29:21 +02:00
commit d510d777ca
12 changed files with 1246 additions and 0 deletions

View File

@@ -0,0 +1,39 @@
#!/usr/bin/env bash
# Copyright (c) 2025. LUXIM d.o.o., Slovenia - Matjaž Mozetič.
_backtunnel_complete() {
local cur
cur="${COMP_WORDS[COMP_CWORD]}"
if [[ ${COMP_CWORD} -eq 1 ]]; then
compopt -o filenames 2>/dev/null
mapfile -t COMPREPLY < <(compgen -d -- "${cur}")
return 0
fi
if [[ ${COMP_CWORD} -eq 2 ]]; then
mapfile -t COMPREPLY < <(compgen -W "with from" -- "${cur}")
return 0
fi
if [[ ${COMP_CWORD} -eq 4 && "${COMP_WORDS[2]}" == "with" ]]; then
mapfile -t COMPREPLY < <(compgen -W "for" -- "${cur}")
return 0
fi
if [[ ${COMP_CWORD} -eq 5 && "${COMP_WORDS[2]}" == "with" && "${COMP_WORDS[4]}" == "for" ]]; then
mapfile -t COMPREPLY < <(compgen -W "10m 30m 1h 2h 6h 12h 1d 2d" -- "${cur}")
return 0
fi
if [[ "${COMP_WORDS[2]}" == "from" ]]; then
COMPREPLY=()
return 0
fi
COMPREPLY=()
}
complete -F _backtunnel_complete backtunnel-share
complete -F _backtunnel_complete backtunnel-access