Re: dbus and OpenVPN Autostart



On Tue, 2009-02-24 at 11:16 -0800, Harald S. wrote:
> 
> 
> Dan Williams wrote:
> > 
> > On Tue, 2009-02-24 at 08:37 -0800, Harald S. wrote:
> > 
> >> 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.
> > 
> > 
> 
> I forgot to mention that at the location I usually sit know I use wired
> network configured with DHCP. How does the script know the UUID for this
> connection? I also did not understand what was meant by "passed to the
> script in the CONNECTION_UUID environment variable".

By "Connection" I mean the package of config settings that
NetworkManager uses to bring up a network device.  Every
activate/deactivate action NM performs on a device will have an
associated "Connection" object.  These connections are stored in GConf
(for GNOME), somewhere else for KDE, or in your distro config files.
NetworkManager generates a UUID for each connection.  Thus, when your
dispatcher script gets called, its environment will already have the
CONNECTION_UUID variable set, and your dispatcher script can use that to
figure out what VPN to use.

Dan




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