set up tinyproxy and /etc/environment for system wide proxy.
By default, this only reports how you can set this up. No changes to the system will be made unless the first argument is 'update' or UPDATE=1 is found in the environment.
No root access is required for dry-run.
The values configured at the top of the script are for an internal cloud I have access to. They should be easily modifyable to your liking. Once set up, all new shells should receive 'http_proxy' and 'https_proxy' in their environment, and then "just work" to send all requests through the local proxy.
If you need to add or remove 'no_upstream' entries to tinyproxy config you can do so later, and then just restart tinyproxy. There is then no need to re-set environment variables for existing programs, the changes will just be immediate.
This script can generally be executed via curl | bash
to set a system to
configure tiny proxy.
The proxy
command is included here just to give it a place to live.
It's usage is not really needed with tinyproxy configuration as described.
But if you do not use tinyproxy as above, then you can just enable / disable use of a proxy with:
proxy <command>
run command with http_proxy and friends configuredproxy -n <command>
unset proxy environment variables and run command
If is not given, then a shell is invoked.