Skip to content

Instantly share code, notes, and snippets.

@leostaples
Created March 20, 2013 11:08
Show Gist options
  • Save leostaples/5203888 to your computer and use it in GitHub Desktop.
Save leostaples/5203888 to your computer and use it in GitHub Desktop.
~/.ssh/proxy
#!/bin/bash
NETWORK_LOCATION="$(/usr/sbin/scselect 2>&1 | egrep '^ \* ' | sed 's:.*(\(.*\)):\1:')"
if [ "$NETWORK_LOCATION" = "BBC On Network" ]; then
if [[ "$1" == "localhost" || "$1" == "127.0.0.1" || "$1" =~ "sandbox.dev.bbc.co.uk" ]]; then
/usr/local/bin/connect $1 $2
else
/usr/local/bin/connect -S socks-gw.reith.bbc.co.uk:1085 $1 $2
fi
else
/usr/local/bin/connect $1 $2
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment