I'm running Ubuntu-Studio 12.10 using GNOME-3, and I'm trying to set up a bash script in /etc/network/if-up.d to auto-configure my proxy settings based on the SSID of the network I'm connected to. I cannot get gsettings to work automatically, using any of the following:
gsettings set org.gnome.system.proxy mode "manual" sudo -u blaine gsettings set org.gnome.system.proxy mode "manual" su blaine -c 'gsettings set org.gnome.system.proxy mode "manual"'
Furthermore, I'd like the script to change the environment variables http_proxy, https_proxy and so forth so that things like Wine would recognise them without having to log out and back in, and five days of googling tells me this is impossible.
Except - I know it can be done. The "Apply System-Wide" button in Unity does all this without having to re-log. Some further digging revealed this article that suggest the button accesses com.ubuntu.systemservice.setProxy, which is presumably part of the ubuntu-system-service package.
Is it possible to use ubuntu-system-service to set a system-wide proxy via bash, the terminal, or similar?