From d9f46033ce8f176809a99128858bc493b1064051 Mon Sep 17 00:00:00 2001 From: hjp Date: Mon, 1 Oct 2007 15:06:50 +0000 Subject: [PATCH] Check for available proxies instead of relying on the host name. --- .zprofile | 12 +++++++++++- .zshenv | 12 ------------ 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/.zprofile b/.zprofile index c1cde28..6d20336 100644 --- a/.zprofile +++ b/.zprofile @@ -1,5 +1,5 @@ # -# $Id: .zprofile,v 1.17 2006-12-18 16:22:26 hjp Exp $ +# $Id: .zprofile,v 1.18 2007-10-01 15:06:50 hjp Exp $ # # this is sourced for login shells after .zshenv but before .zshrc # @@ -24,3 +24,13 @@ if [ -f /etc/X11/rgb.txt ] then export RGBDEF=/etc/X11/rgb.txt fi + +unset http_proxy +for i in http://zeno.hjp.at:3128/ http://squid.wsr.ac.at:3128/ +do + if http_proxy=$i wget -q -O /dev/null http://www.hjp.at + then + http_proxy=$i + break + fi +done diff --git a/.zshenv b/.zshenv index b2c696b..bb905bf 100644 --- a/.zshenv +++ b/.zshenv @@ -205,18 +205,6 @@ case "$FQDN" in ;; esac -case "$FQDN" in - *.hjp.at) - export http_proxy=http://zeno.hjp.at:3128/ - ;; - samkar.wsr.ac.at|wsrgeh.wsr.ac.at|laire.wsr.ac.at|spiridon*.wsr.ac.at|habanero.wsr.ac.at|haldir.wsr.ac.at|tanstaafl.wsr.ac.at|shalmaneser.wsr.ac.at) - unset http_proxy - ;; - *.wsr.ac.at) - export http_proxy=http://squid.wsr.ac.at:3128/ - ;; -esac - case "$FQDN" in