2011-04-20 22:24:51 +00:00
|
|
|
#! /bin/bash
|
2012-03-01 22:09:33 +00:00
|
|
|
SCRIPTDIR=`dirname $0`
|
|
|
|
# Check oe-git-proxy-socks exists
|
|
|
|
PROXYSOCKS=`which oe-git-proxy-socks 2> /dev/null`
|
|
|
|
if [ -z "$PROXYSOCKS" -a -e "$SCRIPTDIR/oe-git-proxy-socks.c" ]; then
|
|
|
|
# If not try and build it
|
|
|
|
gcc $SCRIPTDIR/oe-git-proxy-socks.c -o $SCRIPTDIR/oe-git-proxy-socks
|
|
|
|
fi
|
|
|
|
PROXYSOCKS=`which oe-git-proxy-socks 2> /dev/null`
|
|
|
|
if [ ! -x "$PROXYSOCKS" ]; then
|
2012-03-01 23:53:24 +00:00
|
|
|
# If that fails, we can see if netcat (nc) is available
|
|
|
|
NETCAT=`which nc 2> /dev/null`
|
|
|
|
if [ ! -x "$NETCAT" ]; then
|
|
|
|
# If that fails, explain to the user
|
|
|
|
echo "Unable to find oe-git-proxy-socks. This is usually created with the command"
|
|
|
|
echo "'gcc scripts/oe-git-proxy-socks.c -o scripts/oe-git-proxy-socks' which we tried"
|
|
|
|
echo "but it doesn't seem to have worked. Please compile the binary manually."
|
|
|
|
echo "Alternativly, install nc (netcat) on this machine."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
exec $NETCAT -x $GIT_PROXY_HOST:$GIT_PROXY_PORT "$@"
|
2012-03-01 22:09:33 +00:00
|
|
|
fi
|
2011-04-20 22:24:51 +00:00
|
|
|
oe-git-proxy-socks -S $GIT_PROXY_HOST:$GIT_PROXY_PORT $@
|