From 0e84e1bdda1d0e4998de594e809e7318f9732dbb Mon Sep 17 00:00:00 2001 From: "Lockszmith (@VAST)" Date: Thu, 3 Apr 2025 22:47:24 -0400 Subject: [PATCH] Improve tssh-with-tunnel --- .../bin/executable_tssh-with-tunnel | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/_src.posix/private_dot_local/bin/executable_tssh-with-tunnel b/_src.posix/private_dot_local/bin/executable_tssh-with-tunnel index 6da0438..189a960 100644 --- a/_src.posix/private_dot_local/bin/executable_tssh-with-tunnel +++ b/_src.posix/private_dot_local/bin/executable_tssh-with-tunnel @@ -30,19 +30,18 @@ SSHUSER="${SSHUSER:-vastdata}" TARGET="${SSHUSER}@$(tsh-get "$SEARCH" "$SSHUSER")" -VMS="${VMS:-"$(awk '$5 { split($4, cidr, "/"); print cidr[1] }' <(tsh ssh "${TARGET}" bash -l <&2 -eval "${RUN} tsh ssh ${TUNNEL} '${TARGET}' ${*:2}" +TUNNEL="-L ${LOCAL_PORT}:${VMS}:${TARGET_PORT}" +SSH_OPTS="${SSH_OPTS:--N}" + +printf "Executing: %s ...\n" "tsh ssh ${TUNNEL} ${TARGET} ${*:2}" >&2 +eval "${RUN} tsh ssh ${SSH_OPTS} ${TUNNEL} '${TARGET}' ${*:2}"