Originally posted by Xeo:
I'm writing an AppleScript and I'd like to be able to tell whether my proxy settings (in Network) are on or off.
Is there a way I can do this by either using a unix command or maybe using defaults to read the current setting (I can't find the Network preferences anywhere).
Thanks in advance.
I'm not sure how easy it is going to be to AppleScript this, but you can find out the System Configuration for this kind of thing using the command line utility
scutil.
Here's an example of using it:
Code:
% scutil
> open
> get Setup:/Network/Service/0/Proxies
> d.show
<dictionary> {
HTTPSPort : 3128
RTSPEnable : 0
HTTPSEnable : 1
HTTPProxy : proxy.my.local.domain
ExceptionsList : <array> {
0 : *.my.local.domain
1 : my.local.domain
}
HTTPPort : 3128
SOCKSProxy : proxy.my.local.domain
FTPPassive : 1
HTTPEnable : 1
FTPProxy : proxy.my.local.domain
SOCKSEnable : 1
FTPPort : 3128
SOCKSPort : 1080
GopherEnable : 0
FTPEnable : 1
HTTPSProxy : proxy.my.local.domain
}
> quit
%
Could be interesting trying to script it, but it does tell you the information you need.
- proton