[Icecast-dev] [PATCH] include mount point from single text files in a given directory
marco
marco at teknusi.org
Sun Feb 19 01:28:06 PST 2012
This patch introduces a new configuration directive, mount-include, which syntax is basically:
<mount-include>
<dir>/a/directory/path/here/</dir>
</mount-include>
The <dir> element points to a directory. The path must be absolute and must include a trailing slash.
Inside the directory pointed by the did element we place n files each one with a mount section, which will be loaded at the start of the server or after a kill -HUP of the icecast process.
e.g.
# vim /a/directory/path/here/radiomount
<mount>
<mount-name>/radiomount</mount-name>
<username>radiomount</username>
<password>hackme</password>
</mount>
The patch:
- parses the mount-include element and takes the dir path
- takes all the regular files (or link to regular files) in the directory
- xmlParse them
- takes the root element and add a sibling to mount-include. At this point the parsed mount directives are added to the xml configuration and the configuration parser will do its work as usual.
Don't know if it is of any help, but it keeps my life simple when adding or removing a mountpoint.
This patch applies to src/cfgfile.c, no other files were modified (of course you have to change the configuration file). I also added an entry in AUTHORS, but i do not know what is your policy about that.
marco
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch-mount-include.patch
Type: application/octet-stream
Size: 3729 bytes
Desc: not available
Url : http://lists.xiph.org/pipermail/icecast-dev/attachments/20120219/9b05da45/attachment-0001.obj
More information about the Icecast-dev
mailing list