example [add|delete] share command

Ulf Bartelt ulf at twc.de
Mon May 7 07:30:44 GMT 2001


Gerald Carter wrote:
> 
> FYI...

:-)

> I just checked in a perl script that is a rought example of an
> 'add|delete share command'.  See examples/misc/modify_smb_conf.pl.
>
> Hint: it parses smb.conf into a hash of hashes and so could easily be made
> into a 'add|delete printer command' :-)
> 
> Enjoy.

I kicked all but some global settings out of smb.conf and put each share
definition in an own file in /etc/smb.conf.d.

The last line of my smb.conf is to include /etc/smb.conf.d/INCLUDES.

This file is a list of include statements for each file matching *.smb
in /etc/smb.conf.d and there is a command "update-samba-shares" to
(re)generate INCLUDES.

So whenever I install a package defining an own share, it contains only
the small *.smb file and it will call update-samba-shares afterwards in
some postinstall functionality...


Why???


I...
... needed it someday and I had too less time to think about complicated
conf file parsing. Especially adding/killing a share upon package
installation/removal had be solved...
... do not use webmin, swat or other tools that might get confused by
include statements because I'm kinda prehistoric and prefer simple
things...




More information about the samba-ntdom mailing list