tunnelier list

This commit is contained in:
2023-09-01 11:08:49 +03:00
parent a1e97b69eb
commit 4d72f705d8

View File

@@ -25,6 +25,10 @@ If run with arguments, runs an ssh tunnel with arguments:
ssh-tunnelier hostname [local-port] remote-port ssh-tunnelier hostname [local-port] remote-port
If local port missing, the same port assumed in local If local port missing, the same port assumed in local
Switches:
-h --help This help
-l List config entries
" "
exit 0 exit 0
} }
@@ -193,10 +197,16 @@ function instant_entry() {
printf "${colMenu}See the connection in 'list ssh'${colZ}\n" printf "${colMenu}See the connection in 'list ssh'${colZ}\n"
} }
for (( i=1; i<=$#; i++ )); do
[[ ${!i} = "-l" ]] && LISTONLY=1
done
if [[ "$LISTONLY" -ne 1 ]]; then
if [[ -n "$1" ]]; then if [[ -n "$1" ]]; then
run_args "$@" run_args "$@"
exit $? exit $?
fi fi
fi
while true; do while true; do
ids=() ids=()
@@ -208,6 +218,9 @@ while true; do
printf "${colRow}ID PID host: ports\n" printf "${colRow}ID PID host: ports\n"
read_config read_config
printf "$colZ" printf "$colZ"
if [[ "$LISTONLY" -eq 1 ]]; then
break
fi
read input read input
[[ "$input" = "q" ]] && exit 0 [[ "$input" = "q" ]] && exit 0