Let my HOME alone 1/2

This commit is contained in:
Geoffrey Frogeye 2019-04-25 22:54:51 +02:00
parent 2ae37e902e
commit a83e45df5e
94 changed files with 328 additions and 58 deletions

24
config/scripts/tunnel Executable file
View file

@ -0,0 +1,24 @@
#!/usr/bin/env bash
# Dynamically determines if the ssh connection
# is to be proxied through `proxytunnel`
# To be used with ssh_config ProxyCommand
host="$1"
port="$2"
if [ -z "$http_proxy" ]; then
socat "TCP:$host:$port" -
else
proxy=$(echo "$http_proxy" | sed 's/^https\?:\/\///' | sed 's/\/$//')
port=443 # Most won't want this
echo "$proxy" | grep '@'
if [ $? == 0 ]; then
user=$(echo $proxy | cut -d '@' -f 2)
proxy=$(echo $proxy | cut -d '@' -f 1)
proxytunnel -p $proxy -P $user -d $host:$port
else
proxytunnel -p $proxy -d $host:$port
fi
fi