From c5e49f1a3529fd1f7928fb679ad7d9a652e87c45 Mon Sep 17 00:00:00 2001 From: epoch Date: Thu, 24 Feb 2022 01:46:37 +0000 Subject: switched from using $1 in multiple spots to using $uri. set the teminal's title to the URI so I can copy it out later with tools in xtools repo --- ssh_hack | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/ssh_hack b/ssh_hack index 1af4f7c..cac6623 100755 --- a/ssh_hack +++ b/ssh_hack @@ -1,11 +1,12 @@ #!/usr/bin/env bash ### we need to export each of the query string variables ### then send them over ssh -q="$(printf "%s\n" "$1" | uricut -q)" -p="$(printf "%s\n" "$1" | uricut -p)" -d="$(printf "%s\n" "$1" | uricut -d)" -P="$(printf "%s\n" "$1" | uricut -P)" -u="$(printf "%s\n" "$1" | uricut -u)" +uri="$1" +q="$(printf "%s\n" "$uri" | uricut -q)" +p="$(printf "%s\n" "$uri" | uricut -p)" +d="$(printf "%s\n" "$uri" | uricut -d)" +P="$(printf "%s\n" "$uri" | uricut -P)" +u="$(printf "%s\n" "$uri" | uricut -u)" eval "$(printf '%s\n' "$q" | tr '&' ' ' | grep '[^ ]*=' | sed 's/^/export /g')" if [ "$p" ];then @@ -18,8 +19,10 @@ if [ "$u" ];then HACK_USER="$u@" fi +set_terminal_title "$uri" + if [ "$q" ];then -tmpfile=$(mktemp); + 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} else -- cgit v1.2.3