From e30cd702286d91b99107bab4005e32e1e480c83f Mon Sep 17 00:00:00 2001 From: epoch Date: Sun, 14 Nov 2021 04:27:43 +0000 Subject: ssh_hack was failing if there were no query string --- ssh_hack | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'ssh_hack') diff --git a/ssh_hack b/ssh_hack index e882cd2..1af4f7c 100755 --- a/ssh_hack +++ b/ssh_hack @@ -18,9 +18,12 @@ if [ "$u" ];then HACK_USER="$u@" fi +if [ "$q" ];then tmpfile=$(mktemp); -printf '%s\n' "$q" | tr '&' '\n' | cut -d= -f1 | sed 's/^/SendEnv /g' > "$tmpfile" - -ssh -F "$tmpfile" -t ${HACK_PORT} ${HACK_USER}${d} ${p:1} + printf '%s\n' "$q" | tr '&' '\n' | cut -d= -f1 | sed 's/^/SendEnv /g' > "$tmpfile" + ssh -F "$tmpfile" -t ${HACK_PORT} ${HACK_USER}${d} ${p:1} +else + ssh -t ${HACK_PORT} ${HACK_USER}${d} ${p:1} +fi #ssh -F <(printf '%s\n' "$q" | tr '&' '\n' | cut -d= -f1 | sed 's/^/SendEnv /g') -t ${HACK_PORT} ${HACK_USER}${d} ${p:1} #ssh -F <(printf '%s\n' "$q" | tr '&' '\n' | cut -d= -f1 | sed 's/^/SendEnv /g') -t ${HACK_PORT} ${HACK_USER}${d} ${p:1} -- cgit v1.2.3