profile.d/proxy lit aussi les valeurs par défaut pour l'hôte
This commit is contained in:
parent
b8d3d70593
commit
2fa0791f5f
|
@ -11,9 +11,16 @@ function set_proxy() {
|
||||||
local FTP_PROXY_HOST FTP_PROXY_PORT
|
local FTP_PROXY_HOST FTP_PROXY_PORT
|
||||||
local PROXY_LOCAL_DOMAINS AUTHFTP_PROXY_HOST
|
local PROXY_LOCAL_DOMAINS AUTHFTP_PROXY_HOST
|
||||||
|
|
||||||
[ -f "$HOME/etc/default/proxy" ] && source "$HOME/etc/default/proxy"
|
local default_profile
|
||||||
|
if [ -f "$HOME/etc/default.${HOSTNAME%%.*}/proxy" ]; then
|
||||||
|
default_profile="$HOME/etc/default.${HOSTNAME%%.*}/proxy"
|
||||||
|
elif [ -f "$HOME/etc/default/proxy" ]; then
|
||||||
|
default_profile="$HOME/etc/default/proxy"
|
||||||
|
fi
|
||||||
|
[ -f "$default_profile" ] && source "$default_profile"
|
||||||
|
|
||||||
if [ -n "$PROXY_ENABLE_LIBPROXY" -a -x /usr/bin/proxy ]; then
|
if [ -n "$PROXY_ENABLE_LIBPROXY" -a -x /usr/bin/proxy ]; then
|
||||||
local -a proxies=($(proxy <<<http://www.google.fr/ 2>/dev/null))
|
local -a proxies=($(/usr/bin/proxy <<<http://www.google.fr/ 2>/dev/null))
|
||||||
proxy="${proxies[0]}"
|
proxy="${proxies[0]}"
|
||||||
if [ "$proxy" == "direct://" ]; then
|
if [ "$proxy" == "direct://" ]; then
|
||||||
# pas de proxy
|
# pas de proxy
|
||||||
|
@ -29,7 +36,7 @@ function set_proxy() {
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
unset no_proxy
|
unset no_proxy
|
||||||
elif [ -f "$HOME/etc/default/proxy" ]; then
|
elif [ -f "$default_profile" ]; then
|
||||||
# proxy par défaut
|
# proxy par défaut
|
||||||
if [ -n "$HTTP_PROXY_HOST" ]; then
|
if [ -n "$HTTP_PROXY_HOST" ]; then
|
||||||
proxy="http://$HTTP_PROXY_HOST:${HTTP_PROXY_PORT:-3128}/"
|
proxy="http://$HTTP_PROXY_HOST:${HTTP_PROXY_PORT:-3128}/"
|
||||||
|
|
Loading…
Reference in New Issue