Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thomaspoignant/a768887d86caa7aa94ebf1b22b46eced to your computer and use it in GitHub Desktop.
Save thomaspoignant/a768887d86caa7aa94ebf1b22b46eced to your computer and use it in GitHub Desktop.
Get your proxy configuration in bash directly from zscaller .pac file
PROXY=http://$(curl -q http://pac.zscalertwo.net/XXX/proxypac-prod.pac 2>/dev/null | grep "PROXY" | grep -oP "\b(?:\d{1,3}\.){3}\d{1,3}\b:[0-9]*" | head -n 1)
echo "SETTING PROXY : $PROXY"
export HTTP_PROXY=$PROXY
export HTTPS_PROXY=$PROXY
export http_proxy=$PROXY
export https_proxy=$PROXY
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment