Re: possible to use scutil to change system HTTP proxy settings?
Re: possible to use scutil to change system HTTP proxy settings?
- Subject: Re: possible to use scutil to change system HTTP proxy settings?
- From: James Reynolds <email@hidden>
- Date: Thu, 20 Apr 2006 15:26:38 -0600
At 5:18 PM -0400 4/20/06, Allan Nathanson wrote:
You are using the scutil command to modify the configuration in the
dynamic store. What you want to do is modify the settings in the
stored preferences. While it's the settings in the dynamic store
that are used by any running applications they will be
updated/overwritten whenever the stored preferences are changed.
... and in most cases, it's the stored preferences that
are displayed by the UI.
- Allan
This would be an excellent time to use ncutil, right?
Here is some perl code I use to manage proxies with ncutil 2.0.2 (not
sure if it works with 3.xz):
$location_of_ncutil = "/usr/sbin/ncutil"; # version 2.0.2
%postm_http_proxy_settings = ( 'enable' => '0',
'host' => '',
'port' => '',
);
%postm_https_proxy_settings = ( 'enable' => '0',
'host' => '',
'port' => '',
);
%postm_ftp_proxy_settings = ( 'enable' => '0',
'host' => '',
'port' => '',
);
%postm_rtsp_proxy_settings = ( 'enable' => '0',
'host' => '',
'port' => '',
);
%postm_gopher_proxy_settings = ( 'enable' => '0',
'host' => '',
'port' => '',
);
%postm_SOCKS_proxy_settings = ( 'enable' => '0',
'host' => '',
'port' => '',
);
@postm_host_exceptions = (
);
system "\"$location_of_ncutil\" setprop \"/Automatic/Built-in
Ethernet/Proxies\" http-proxy-enable
\"$postm_http_proxy_settings{'enable'}\"";
system "\"$location_of_ncutil\" setprop \"/Automatic/Built-in
Ethernet/Proxies\" http-proxy-host
\"$postm_http_proxy_settings{'host'}\"";
system "\"$location_of_ncutil\" setprop \"/Automatic/Built-in
Ethernet/Proxies\" http-proxy-port
\"$postm_http_proxy_settings{'port'}\"";
system "\"$location_of_ncutil\" setprop \"/Automatic/Built-in
Ethernet/Proxies\" https-proxy-enable
\"$postm_https_proxy_settings{'enable'}\"";
system "\"$location_of_ncutil\" setprop \"/Automatic/Built-in
Ethernet/Proxies\" https-proxy-host
\"$postm_https_proxy_settings{'host'}\"";
system "\"$location_of_ncutil\" setprop \"/Automatic/Built-in
Ethernet/Proxies\" https-proxy-port
\"$postm_https_proxy_settings{'port'}\"";
system "\"$location_of_ncutil\" setprop \"/Automatic/Built-in
Ethernet/Proxies\" ftp-proxy-enable
\"$postm_ftp_proxy_settings{'enable'}\"";
system "\"$location_of_ncutil\" setprop \"/Automatic/Built-in
Ethernet/Proxies\" ftp-proxy-host
\"$postm_ftp_proxy_settings{'host'}\"";
system "\"$location_of_ncutil\" setprop \"/Automatic/Built-in
Ethernet/Proxies\" ftp-proxy-port
\"$postm_ftp_proxy_settings{'port'}\"";
system "\"$location_of_ncutil\" setprop \"/Automatic/Built-in
Ethernet/Proxies\" rtsp-proxy-enable
\"$postm_rtsp_proxy_settings{'enable'}\"";
system "\"$location_of_ncutil\" setprop \"/Automatic/Built-in
Ethernet/Proxies\" rtsp-proxy-host
\"$postm_rtsp_proxy_settings{'host'}\"";
system "\"$location_of_ncutil\" setprop \"/Automatic/Built-in
Ethernet/Proxies\" rtsp-proxy-port
\"$postm_rtsp_proxy_settings{'port'}\"";
system "\"$location_of_ncutil\" setprop \"/Automatic/Built-in
Ethernet/Proxies\" gopher-proxy-enable
\"$postm_gopher_proxy_settings{'enable'}\"";
system "\"$location_of_ncutil\" setprop \"/Automatic/Built-in
Ethernet/Proxies\" gopher-proxy-host
\"$postm_gopher_proxy_settings{'host'}\"";
system "\"$location_of_ncutil\" setprop \"/Automatic/Built-in
Ethernet/Proxies\" gopher-proxy-port
\"$postm_gopher_proxy_settings{'port'}\"";
system "\"$location_of_ncutil\" setprop \"/Automatic/Built-in
Ethernet/Proxies\" SOCKS-proxy-enable
\"$postm_SOCKS_proxy_settings{'enable'}\"";
system "\"$location_of_ncutil\" setprop \"/Automatic/Built-in
Ethernet/Proxies\" SOCKS-proxy-host
\"$postm_SOCKS_proxy_settings{'host'}\"";
system "\"$location_of_ncutil\" setprop \"/Automatic/Built-in
Ethernet/Proxies\" SOCKS-proxy-port
\"$postm_SOCKS_proxy_settings{'port'}\"";
system "\"$location_of_ncutil\" setprop \"/Automatic/Built-in
Ethernet/Proxies\" host-exceptions @postm_host_exceptions\n";
system "\"$location_of_ncutil\" -activate read \"/Automatic/Built-in
Ethernet/Proxies\"";
--
Thanks,
James Reynolds - University of Utah - Student Computing Labs
jame(a)scl.utah.edu - james(a)magnusviri.com
- http://james.magnusviri.com - 801-585-9811
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden