Tool

jimgoodall's picture
tool
Reads:

9069

Score:
0
0
 
Comments:

1

Laptop proxy switch

(View Disclaimer)

license: 
Free

I got fed up of having to switch proxy settings on and off between sites, so I wrote this little script to help me!

There are a few configuration steps to go through first:

  1. Go into Control Center and set Network Proxy to use the system proxy settings.
  2. Go into Yast and set your proxy settings to on.
  3. cp /etc/sysconfig/proxy /etc/sysconfig/proxy.on
  4. Go into Yast and set your proxy settings to off.
  5. cp /etc/sysconfig/proxy /etc/sysconfig/proxy.off
  6. Set Firefox to use system settings for proxy
  7. Put this script somewhere and make it executable:
    #!/bin/bash
    # Replace the IP address below with the address of your proxy server.
    ping 172.16.1.1 -c 1 -s 32
    if [ $? = 0 ]
    then
    # If I can ping my proxy server then use it!
    sudo cp /etc/sysconfig/proxy.on /etc/sysconfig/proxy
    else
    # If I can't ping my proxy server then switch off!
    sudo cp /etc/sysconfig/proxy.off /etc/sysconfig/proxy
    fi
    
    
  8. Call this script at startup - I execute it from my .profile script.

NB: you will need to add the executing user your SUDOers list to run without a password for this script to work - you could alternatively change the permissions on the /etc/sysconfig/proxy file to avoid this.


Disclaimer: As with everything else at Cool Solutions, this content is definitely not supported by Novell (so don't even think of calling Support if you try something and it blows up).

It was contributed by a community member and is published "as is." It seems to have worked for at least one person, and might work for you. But please be sure to test, test, test before you do anything drastic with it.




User Comments

supermathie's picture

Foxyproxy

Submitted by supermathie on 16 July 2008 - 10:26am.

If you need any sort of proxy management or fine-grained control, check out FoxyProxy for Firefox. It also makes it dead simple to toggle between proxies.

Granted, it's not systemwide, but also makes things rather easy to control.

© 2013 Novell