Skip to content

Instantly share code, notes, and snippets.

@gitawego
Created October 15, 2019 21:29
Show Gist options
  • Save gitawego/253f0ba67a0fb9ba14680d6055c13138 to your computer and use it in GitHub Desktop.
Save gitawego/253f0ba67a0fb9ba14680d6055c13138 to your computer and use it in GitHub Desktop.
proxify alias behind enterprise
#!/bin/bash
set -e
PROXY_URL=myproxy.socgen.com
PROXY_USERNAME=my_user_name
function proxy_fnc(){
read -s -p "Enter Password: " PROXY_PASSWORD
echo
local prefix="$PROXY_USERNAME:$PROXY_PASSWORD"
http_proxy="$prefix@$PROXY_URL" https_proxy="$prefix@$PROXY_URL" $@
}
# alias proxify=proxy_fnc
# example using alias:
# proxify curl -k https://www.google.com
# example:
proxy_fnc env
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment