[Samba] parsing smb.conf in a script (adding, removing, changing values)?

Tomasz Chmielewski mangoo at wpkg.org
Fri Jun 27 13:18:42 GMT 2008


What do you use to parse smb.conf 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].

How would you do it?

Is there a tool which basically does:

# smb-conf-parser [action] [section] [key] [value]

For example, add "user3" to "valid users" in [homes] would be:

# smb-conf-parser add homes "valid users" user3


Removing "user1" from "valid users" in [data] would be:

# smb-conf-parser del data "valid users" user1

?


-- 
Tomasz Chmielewski
http://wpkg.org


More information about the samba mailing list