Add incomplete support for enable/disable All option#6
Add incomplete support for enable/disable All option#6jmgurney wants to merge 1 commit intorobertklep:masterfrom
Conversation
networksetup only processes one commandline arg (and doesn't error out at the remaining args).. So I don't know of a good way to change multiple ones at a time..
|
@jmgurney one of the things I still want to look in to is how to toggle the proxies programmatically (without an external command). Hopefully, that may solve excessive password dialogs. Aside from that, have you considered using network locations to define a separate set of proxies depending on which network you are in? I have several locations defined depending on where I am, and you can switch between them pretty quickly throught the Apple menu: |
|
ahh, they still have it, just recently upgraded, and getting used to the new OS... Per programmatically changing it, I agree, I did spend some time looking... I did find the SCDynamicStoreCopyProxies function call, but I can't seem to make any changes to it... The docs that MacOSX aren't clear how to make these changes, or even where to find the information to do it. |
|
@jmgurney I think that in the end, a call to However, this requires particular privileges (if you don't have those, you can still call the function but they don't stick) that can be obtained using I'll look into it a bit further, because AFAICS this would require the user to authenticate just once, which is much better than having to authorize every change. |
|
Made some progress: https://gist.github.com/robertklep/188d552ca519005e0c1c It's asking the user to authenticate now, and it seems to disable the proxy. However, the settings don't seem to actually stick. Will need to dig deeper. |

I would like to add support to enable/disable all proxies. This is primarily do that when you go to a captive wifi portal, you can disable all, login, and then reenable all proxies.
I've attached a patch that adds the UI elements, but it turns out that networksetup only processes the first command line argument, so it is unable to do it all in one go. I could iterate over the proxies, but then I believe it would ask me for the password n times, which is annoying.
Comments?
Thanks.