nix: Make nix the root
Which means now I'll have to think about real prefixes in commit names.
This commit is contained in:
parent
550eed06e0
commit
ee178b7d57
190 changed files with 5 additions and 6 deletions
24
unprocessed/config/scripts/tunnel
Executable file
24
unprocessed/config/scripts/tunnel
Executable 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
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue