Script for changing GNOME proxy settings

Most of us are working in corporate environments and corporate environments do love proxies. And I hate them;

  • I hate setting them every morning
  • I hate un-setting them every evening

I am assuming that you also use the same laptop at work and at home.

Since I am so sick of changing proxy settings every time, I created the following bash script to set and unset proxy settings.

[crayon-5bf069ffe1bbf912010610/]

You can run it as follows. In order to unset all the proxy settings, just run it without parameters.

[crayon-5bf069ffe1bcc876944875/]

Now you can set and unset your GNOME proxy settings with one simple command.

If you prefer, you don’t even have to run it at all –by yourself I mean :)– Just create another script under /etc/network/if-up.d and with the following contents. Now every time your computer connects to a network it will call the first script ‘change_proxy.sh’ with appropriate parameters depending on the your IP address.

[crayon-5bf069ffe1bd1215669814/]

*UPDATE: The script above also puts proper my maven settings.xml and also enables/disables proxy for subversion according to the environment. You can add more stuff to this script, if you have more settings that you need to change.*

Read Also:  Why Women Don't Do Programming?

Leave a Reply

Your email address will not be published. Required fields are marked *