![]() |
editing smb.conf (INI files)
Anyone using Samba here? Or knows how an INI-file structure looks like?
What would you use to parse smb.conf or INI-files in a somehow automated/scripted manner? Let's say this is a part of smb.conf: [homes] valid users = user1, user2 [data] valid users = user1, user2 And we want to add "user3" to "valid users" in [homes] in a script. I've searched a bit and found some INI-file parsers, but they are basically for extracting values, not editing/changing/adding them. Are there any perl modules which help editing smb.conf or INI-files in an automated/scripted way? -- Tomasz Chmielewski http://wpkg.org |
Re: editing smb.conf (INI files)
Joe Smith schrieb:
> Tomasz Chmielewski wrote: >> What would you use to parse smb.conf or INI-files in a somehow >> automated/scripted manner? > > Config::Tiny - Read/Write .ini style files with as little code as possible > > # Changing data > $Config->{newsection} = { this => 'that' }; # Add a section > $Config->{section}->{Foo} = 'Not Bar!'; # Change a value > delete $Config->{_}; # Delete a value or section > # Save a config > $Config->write( 'file.conf' ); Thanks a lot! -- Tomasz Chmielewski http://wpkg.org |
| All times are GMT. The time now is 01:17 PM. |
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.