Browse Source

oe-git-proxy: also check all_proxy and http_proxy env variables

Signed-off-by: André Draszik <adraszik@tycoint.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
André Draszik 8 years ago
parent
commit
00fe3004aa
1 changed files with 9 additions and 4 deletions
  1. 9 4
      scripts/oe-git-proxy

+ 9 - 4
scripts/oe-git-proxy

@@ -1,10 +1,12 @@
 #!/bin/bash
 
 # oe-git-proxy is a simple tool to be via GIT_PROXY_COMMAND. It uses socat
-# to make SOCKS5 or HTTPS proxy connections. It uses ALL_PROXY to determine the
-# proxy server, protocol, and port. It uses NO_PROXY to skip using the proxy for
-# a comma delimited list of hosts, host globs (*.example.com), IPs, or CIDR
-# masks (192.168.1.0/24). It is known to work with both bash and dash shells.
+# to make SOCKS5 or HTTPS proxy connections.
+# It uses ALL_PROXY or all_proxy or http_proxy to determine the proxy server,
+# protocol, and port.
+# It uses NO_PROXY to skip using the proxy for a comma delimited list of
+# hosts, host globs (*.example.com), IPs, or CIDR masks (192.168.1.0/24). It
+# is known to work with both bash and dash shells.
 #
 # Example ALL_PROXY values:
 # ALL_PROXY=socks://socks.example.com:1080
@@ -99,6 +101,9 @@ match_host() {
 # If no proxy is set or needed, just connect directly
 METHOD="TCP:$1:$2"
 
+[ -z "${ALL_PROXY}" ] && ALL_PROXY=$all_proxy
+[ -z "${ALL_PROXY}" ] && ALL_PROXY=$http_proxy
+
 if [ -z "$ALL_PROXY" ]; then
 	exec $SOCAT STDIO $METHOD
 fi