I want to modify a file like /etc/gdm/custom.conf from the shell or a script.
# GDM configuration storage
[xdmcp]
[debug]
[daemon]
AutomaticLoginEnable=true;
AutomaticLogin=username;
But the idea is that I can add a line to a section and it check if the section is defined, (add the definition if not), the property is defined, let it undefine (erase the line), (and delete the section header if there is no property defined), etc...
I didn't find anything except gconftool-2 but it do not explain how to modify other files. (there is a shema file there).
Answer
So the answer is NO, there isn't a program/script to achieve this, but can easyly be made for every config file, If someone do something like that, with a little database of which markup use each file, it could become really popular.
conffiles do not have a fixed markup of any kind. Compare f.e. the/etc/gdm/custom.confto/etc/X11/xorg.confor/etc/resolv.conf. – Bobby Jun 22 '10 at 17:22