diff options
author | epoch <epoch@enzo.thebackupbox.net> | 2022-02-24 01:46:37 +0000 |
---|---|---|
committer | epoch <epoch@enzo.thebackupbox.net> | 2022-02-24 01:46:37 +0000 |
commit | c5e49f1a3529fd1f7928fb679ad7d9a652e87c45 (patch) | |
tree | 3ef264c0caa4dd20d819070e025e733017642e0c | |
parent | f43a0d0951c3806da52bdee6c944268a59c28f73 (diff) | |
download | uritools-c5e49f1a3529fd1f7928fb679ad7d9a652e87c45.tar.gz uritools-c5e49f1a3529fd1f7928fb679ad7d9a652e87c45.zip |
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
-rwxr-xr-x | ssh_hack | 15 |
1 files changed, 9 insertions, 6 deletions
@@ -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 |