This script no longer works with 1.2.x+ versions of Dropbox due to the new encrypted config database.

Description

This is a Python script to switch dropbox proxy config values.

Works for dropbox versions 0.7.x, 0.8.x, 1.0.x, 1.1.x and on all platforms (Windows / Mac / Linux) – tested on 0.7.110 on Windows and 0.8.112 on Linux.

Won’t work with dropbox 1.2.x or dropbox 1.3.x because of the new encrypted config database.

Similar in concept to ProxyOnOff but more flexible – this version allows you to switch between multiple proxy settings, instead of just switching the proxy on and off.

Download

Download herehttp://dl.dropbox.com/u/340607/dropbox_switch_proxy.py

Note: there are some errors in the original script that prevented the script from notifying the user of the proxy password not being saved and for the need to re-enter it upon restore. The errors don’t affect the functionality of the script, but I’ve included a diff file here with my corrections so it works as intended: http://dl.dropbox.com/u/135656/dropbox_switch_proxy.patch

I’ve also modified a few lines to store the *ini files in the users $HOME/.dropbox folder.

Usage

First of all you need to install PyDropboxValues, then place dropbox_switch_proxy.py in the same place and make it executable.

Backup your current config database, in case these instructions don’t work properly

pyDropboxValues.py _backup

I’ve had a couple of instances where some (accidentally) corrupt settings in the config database, meant that the dropbox preferences window couldn’t be displayed, and thus the incorrect settings couldn’t be fixed. If this happens to you, just delete the modified config database and copy/rename the backup into place.

To backup your current proxy settings as ‘home’, type

dropbox_switch_proxy.py save home

and this will create `dropbox_proxy_home.ini`

Then e.g. maybe set up dropbox with your work’s proxy settings and type

dropbox_switch_proxy.py save work

and this will create `dropbox_proxy_work.ini`
You can then switch back and forth between ‘home’ and ‘work’ settings (or whatever other settings you create!) by stopping dropbox, then running

dropbox_switch_proxy.py restore home

or

dropbox_switch_proxy.py restore work

and then starting dropbox again.

Limitations

It doesn’t store the proxy password (if there is one), but if it detects that the saved proxy settings require authorisation, it’ll remind you that you need to enter the proxy password into the Dropbox preferences.

As mentioned at the top of this page, it won’t work with Dropbox versions 1.2 onwards because the config databases are now encrypted. So you’re limited to changing the settings by hand.