Re: dbus and OpenVPN Autostart

On Tue, 2009-02-24 at 08:37 -0800, Harald S. wrote:
> Tambet Ingo-2 wrote:
> > 
> > 
> > This functionality is very often requested and a dispatcher script to
> > do that is quite hard to implement. I wrote a script to do that, see
> > the attachment. It needs some configuration first: The UUID of the VPN
> > connection you'd like to get automatically activated, the UUID of the
> > connection with which you want your VPN automatically activated, and
> > the UID of the user who has the VPN connection defined. For the first
> > two, just run the script without any arguments and it'll print out all
> > known connections and their UUIDS. Find your UID with `id -u`. After
> > changing these variables in the beginning of the script with your
> > data, copy it to /etc/NetworkManager/dispatcher.d/ and make sure it's
> > executable.
> > 
> > 
> Thanks a lot for the script. My usecase is slightly different. At the office
> I need vpn to connect to the internet. I also need vpn to access my work
> email from home, but then I use split-tunnelling. Can you point me in the
> right direction to use one vpn connection for a specific access point and a
> different vpn connection for all other connections? I know some python but
> not how to deal with dbus.

Each connection in NM has a UUID.  Since you can obviously get the UUIDs
for both your Home and Work connections (look in gconf or wherever your
desktop environment stores connection details), you can use the UUID
(passed to the script in the CONNECTION_UUID environment variable) to
pick which VPN you want to bring up.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]