views:

27

answers:

1

I use two Internet connections so i want to use bash scripts to automate the task of switching between the two.. the problem is i cant able to configure firefox proxy settings via scripts, so is there a way to do that... does any configuration file exists for firefox so that i can modify over command line..

I have read this entry but this dint helped me much.. (its on windows) http://stackoverflow.com/questions/843340/firefox-proxy-settings-via-command-line

+1  A: 

you can use the "automatic proxy configuration" for this. this field takes a "pac" file which in fact is just a javascript function named FindProxyForURL that can use things like dnsResolve or isInNet to determine wether a proxy is needed or not. there is a wikipedia article which describes the files in detail and i have written a blog post a while a go that gives an example function.

Nikolaus Gradwohl
hi... thanks for the reply.. i saw that javascript on your blog and i am quite excited wondering how to use it.. i am n00b at this.. if you give me some more hints then it would help me to figure out the solution much quicker... :)
Idlecool
you could use the myIpAddress function in an if and deside based on the ipadress of your computer which proxy to return
Nikolaus Gradwohl
yeah! get you.. :) thanks :)
Idlecool