2011-02-16 47 views
1

我經常從一個代理切換到另一個代理,並且需要頻繁更改瀏覽器的代理設置。我試圖編寫一個腳本文件,根據我傳遞給腳本的值更改Firefox的代理。我通過了stackoverflow中的帖子,但似乎沒有什麼與我需要的相關。Ubuntu 10.04中通過終端進行firefox代理設置

+1

你見過狡猾的代理? http://getfoxyproxy.org/ – 2011-02-16 18:03:46

回答

-1
  1. 爲什麼不設置Firefox來使用系統代理設置。
  2. 編寫腳本以更改您的配置文件中的代理設置。
1

我在/etc/NetworkManager/dispatcher.d/腳本,它確定要使用的當前連接的代理,然後調用:

gconf --type string --set /system/proxy/mode "manual" 
gconf --type bool --set /system/http_proxy/use_http_proxy "true" 
gconf --type string --set /system/http_proxy/host $PROXY_HOST 
gconf --type int --set /system/http_proxy/port $PROXY_PORT 
gconf --type bool --set /system/http_proxy/use_same_proxy "true" 
gconf --type bool --set /system/http_proxy/use_authentication $AUTH_REQUIRED 
gconf --type string --set /system/http_proxy/authentication_user $DOMAIN_USER 
gconf --type string --set /system/http_proxy/authentication_password $DOMAIN_PWD