我经常从一个代理切换到另一个代理,需要经常更改浏览器的代理设置。我正在尝试编写一个脚本文件,根据我传递给脚本的值更改firefox的代理。我浏览了stackoverflow中的帖子,但似乎没有什么与我需要的东西非常相关。
答案 0 :(得分: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
答案 1 :(得分:-1)