Re: Connecting to a VPN (vpnc) via DBus



On Tue, 2007-12-11 at 10:47 +0100, Adrien BUSTANY wrote:
> Hi,
> I'd like to write a script for Dispatcher to automatically connect to a 
> VPN when I connect to some specific wlan. I saw some scripts on the 
> internet, but they're not up to date with NM 0.7 api.
> I saw the org.freedesktop.NetworkManager.VPN.Manager.Connect method, but 
> I'm not sure what to pass as the arguments. I think the first is weither 
> to use session or system bus, the second the name of the connection, the 
> third the device (like wlan0, or its path in NetworkManager/Device ?), 
> and I've no idea about the last.
> Has anyone got a clue about this ?

You want to connect to the system bus to talk to NetworkManager.  You'll
need to know the object path of your VPN connection, which is provided
to you by nm-applet.  So you'll want to ask the applet first for it's
list of connections using the NetworkManagerSettings interface, then
once you have the connection you can tell NM to activate the VPN just
like the applet does.

Dan




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