summaryrefslogtreecommitdiff
path: root/ssh_hack
diff options
context:
space:
mode:
authorepoch <epoch@enzo.thebackupbox.net>2022-02-24 01:46:37 +0000
committerepoch <epoch@enzo.thebackupbox.net>2022-02-24 01:46:37 +0000
commitc5e49f1a3529fd1f7928fb679ad7d9a652e87c45 (patch)
tree3ef264c0caa4dd20d819070e025e733017642e0c /ssh_hack
parentf43a0d0951c3806da52bdee6c944268a59c28f73 (diff)
downloaduritools-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
Diffstat (limited to 'ssh_hack')
-rwxr-xr-xssh_hack15
1 files 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