Re: Pre-populate NM-vpnc profiles?



On Wed, 2007-12-05 at 13:33 -0600, Casey Harkins wrote:
> Brian Long wrote:
> > Hello,
> > 
> > I would like to use gconftool-2 or something to pre-populate various
> > system-wide VPN profiles for NetworkManager-vpnc.  Is there any
> > documentation on how to do this?  I have various Cisco pcf files from
> > which I can extract the Gateway, Group, Group Password, etc.  Is there
> > an easy way to add a bunch of NM-vpnc profiles from the command-line?
> > This would allow me to wrap it inside an RPM, etc.
> 
> Not necessarily any documentation, however you should be able to extract 
> the relevant configuration from gconf directly. Configure at least one 
> vpn (I believe you can even import the pcf files in the vpn 
> configuration dialog), then use gconf-editor or something to find the 
> appropriate configuration under /system/networking/connections/.
> 
> There are a couple of problems that will have to be overcome. First, all 
> NM connections (including wired/wifi/vpn) are enumerated beneath that 
> gconf location (at least on 0.7). I'm not sure how NM will react if 
> these are out of order or non numeric. Depending on the configuration 
> needed, it might be necessary to do this from a login script for the 
> user, rather than as system-wide gconf settings (if key 
> locations/usernames etc are stored in gconf).

(I'm talking about 0.7 here)

It shouldn't matter what the path is in GConf.  Numerics got picked as
the default paths just because they're pretty easy to handle.  If you
wanted to use a string that should work too (in fact, give it a shot and
let me know if the connection doesn't get found and I'll look into it).

So if you really want a stable connection, export the connection details
with:

gconftool-2 --dump /system/networking/connections/6 > my-connection.xml

Edit the resulting xml to change base directory to, say, "CompanyNet":

  <entrylist base="/system/networking/connections/CompanyNet">

then, roll that .xml file into an RPM and in the %install section do
something like:

gconftool-2 --load %{SOURCE0}

Not sure if you need to give a directory to load stuff into with --load,
you might.

Dan




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